Index: test/cctest/test-regexp.cc |
diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc |
index ca432cfde6035fc4d8417a1f659e9b3f7fb2fa53..26b019eeb9e7c6ad4b09f526fed0a0b7c9cf2379 100644 |
--- a/test/cctest/test-regexp.cc |
+++ b/test/cctest/test-regexp.cc |
@@ -110,6 +110,9 @@ static void CheckParseEq(const char* input, const char* expected) { |
CHECK(result.error.is_null()); |
std::ostringstream os; |
result.tree->Print(os, &zone); |
+ if (strcmp(expected, os.str().c_str()) != 0) { |
+ printf("%s | %s\n", expected, os.str().c_str()); |
+ } |
CHECK_EQ(0, strcmp(expected, os.str().c_str())); |
} |
@@ -269,6 +272,7 @@ void TestRegExpParser(bool lookbehind) { |
CheckParseEq("(a)\\1", "(: (^ 'a') (<- 1))"); |
CheckParseEq("(a\\1)", "(^ 'a')"); |
CheckParseEq("(\\1a)", "(^ 'a')"); |
+ CheckParseEq("(\\2)(\\1)", "(: (^ (<- 2)) (^ (<- 1)))"); |
CheckParseEq("(?=a)?a", "'a'"); |
CheckParseEq("(?=a){0,10}a", "'a'"); |
CheckParseEq("(?=a){1,10}a", "(: (-> + 'a') 'a')"); |
@@ -375,8 +379,8 @@ void TestRegExpParser(bool lookbehind) { |
CHECK_MIN_MAX("(?:ab)|cde", 2, 3); |
CHECK_MIN_MAX("(ab)", 2, 2); |
CHECK_MIN_MAX("(ab|cde)", 2, 3); |
- CHECK_MIN_MAX("(ab)\\1", 2, 4); |
- CHECK_MIN_MAX("(ab|cde)\\1", 2, 6); |
+ CHECK_MIN_MAX("(ab)\\1", 2, RegExpTree::kInfinity); |
+ CHECK_MIN_MAX("(ab|cde)\\1", 2, RegExpTree::kInfinity); |
CHECK_MIN_MAX("(?:ab)?", 0, 2); |
CHECK_MIN_MAX("(?:ab)*", 0, RegExpTree::kInfinity); |
CHECK_MIN_MAX("(?:ab)+", 2, RegExpTree::kInfinity); |