From e830b1a047a2156e505b3c6e8f9d3e75ee5f5286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BF=97=E6=B6=9B?= Date: Fri, 23 Sep 2022 02:11:22 +0000 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=86=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=20TEST(RE2,=20Bug26356109)?= =?UTF-8?q?=20TEST(RE2,=20Issue310)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘志涛 --- re2/testing/re2_test.cc | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/re2/testing/re2_test.cc b/re2/testing/re2_test.cc index ae101d3..df4a451 100644 --- a/re2/testing/re2_test.cc +++ b/re2/testing/re2_test.cc @@ -1622,27 +1622,6 @@ TEST(RE2, Bug21371806) { ASSERT_TRUE(re.ok()); } -/*待处理的 -TEST(RE2, Bug26356109) { - // Bug in parser caused by factoring of common prefixes in alternations. - - // In the past, this was factored to "a\\C*?[bc]". Thus, the automaton would - // consume "ab" and then stop (when unanchored) whereas it should consume all - // of "abc" as per first-match semantics. - RE2 re("a\\C*?c|a\\C*?b"); - ASSERT_TRUE(re.ok()); - - std::string s = "abc"; - StringPiece m; - - ASSERT_TRUE(re.Match(s, 0, s.size(), RE2::UNANCHORED, &m, 1)); - ASSERT_EQ(m, s) << " (UNANCHORED) got m='" << m << "', want '" << s << "'"; - - ASSERT_TRUE(re.Match(s, 0, s.size(), RE2::ANCHOR_BOTH, &m, 1)); - ASSERT_EQ(m, s) << " (ANCHOR_BOTH) got m='" << m << "', want '" << s << "'"; -} -*/ - TEST(RE2, Issue104) { // RE2::GlobalReplace always advanced by one byte when the empty string was // matched, which would clobber any rune that is longer than one byte. @@ -1660,21 +1639,4 @@ TEST(RE2, Issue104) { ASSERT_EQ("小人小类小", s); } -/*待处理的 -TEST(RE2, Issue310) { - // (?:|a)* matched more text than (?:|a)+ did. - - std::string s = "aaa"; - StringPiece m; - - RE2 star("(?:|a)*"); - ASSERT_TRUE(star.Match(s, 0, s.size(), RE2::UNANCHORED, &m, 1)); - ASSERT_EQ(m, "") << " got m='" << m << "', want ''"; - - RE2 plus("(?:|a)+"); - ASSERT_TRUE(plus.Match(s, 0, s.size(), RE2::UNANCHORED, &m, 1)); - ASSERT_EQ(m, "") << " got m='" << m << "', want ''"; -} -*/ - } // namespace re2 -- Gitee