Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: third_party/re2/re2/testing/mimics_pcre_test.cc

Issue 1544433002: Replace RE2 import with a dependency (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-Added LICENSE and OWNERS file Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/re2/re2/testing/filtered_re2_test.cc ('k') | third_party/re2/re2/testing/null_walker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/re2/re2/testing/mimics_pcre_test.cc
diff --git a/third_party/re2/re2/testing/mimics_pcre_test.cc b/third_party/re2/re2/testing/mimics_pcre_test.cc
deleted file mode 100644
index f96509298556a68e24621493416568c95d38e8a2..0000000000000000000000000000000000000000
--- a/third_party/re2/re2/testing/mimics_pcre_test.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2008 The RE2 Authors. All Rights Reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-#include "util/test.h"
-#include "re2/prog.h"
-#include "re2/regexp.h"
-
-namespace re2 {
-
-struct PCRETest {
- const char* regexp;
- bool should_match;
-};
-
-static PCRETest tests[] = {
- // Most things should behave exactly.
- { "abc", true },
- { "(a|b)c", true },
- { "(a*|b)c", true },
- { "(a|b*)c", true },
- { "a(b|c)d", true },
- { "a(()|())c", true },
- { "ab*c", true },
- { "ab+c", true },
- { "a(b*|c*)d", true },
- { "\\W", true },
- { "\\W{1,2}", true },
- { "\\d", true },
-
- // Check that repeated empty strings do not.
- { "(a*)*", false },
- { "x(a*)*y", false },
- { "(a*)+", false },
- { "(a+)*", true },
- { "(a+)+", true },
- { "(a+)+", true },
-
- // \v is the only character class that shouldn't.
- { "\\b", true },
- { "\\v", false },
- { "\\d", true },
-
- // The handling of ^ in multi-line mode is different, as is
- // the handling of $ in single-line mode. (Both involve
- // boundary cases if the string ends with \n.)
- { "\\A", true },
- { "\\z", true },
- { "(?m)^", false },
- { "(?m)$", true },
- { "(?-m)^", true },
- { "(?-m)$", false }, // In PCRE, == \Z
- { "(?m)\\A", true },
- { "(?m)\\z", true },
- { "(?-m)\\A", true },
- { "(?-m)\\z", true },
-};
-
-TEST(MimicsPCRE, SimpleTests) {
- for (int i = 0; i < arraysize(tests); i++) {
- const PCRETest& t = tests[i];
- for (int j = 0; j < 2; j++) {
- Regexp::ParseFlags flags = Regexp::LikePerl;
- if (j == 0)
- flags = flags | Regexp::Latin1;
- Regexp* re = Regexp::Parse(t.regexp, flags, NULL);
- CHECK(re) << " " << t.regexp;
- CHECK_EQ(t.should_match, re->MimicsPCRE())
- << " " << t.regexp << " "
- << (j==0 ? "latin1" : "utf");
- re->Decref();
- }
- }
-}
-
-} // namespace re2
« no previous file with comments | « third_party/re2/re2/testing/filtered_re2_test.cc ('k') | third_party/re2/re2/testing/null_walker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698