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

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

Issue 10873029: Migrate WebRequestRedirectByRegExAction to use RE2 and roll RE2 to revision 97:401ab4168e8e (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT Created 8 years, 4 months 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/regexp.cc ('k') | third_party/re2/re2/testing/parse_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/re2/re2/testing/filtered_re2_test.cc
diff --git a/third_party/re2/re2/testing/filtered_re2_test.cc b/third_party/re2/re2/testing/filtered_re2_test.cc
index 7755d30622e29ac7e65f6244a45c4c11eb37918c..e3a0dd1376c1d6253401e27427b7154f76ec6950 100644
--- a/third_party/re2/re2/testing/filtered_re2_test.cc
+++ b/third_party/re2/re2/testing/filtered_re2_test.cc
@@ -39,6 +39,23 @@ TEST(FilteredRE2Test, SmallOrTest) {
EXPECT_EQ(id, v.matches[0]);
}
+TEST(FilteredRE2Test, SmallLatinTest) {
+ FLAGS_filtered_re2_min_atom_len = 3;
+ FilterTestVars v;
+ int id;
+
+ v.opts.set_utf8(false);
+ v.f.Add("\xde\xadQ\xbe\xef", v.opts, &id);
+ v.f.Compile(&v.atoms);
+ EXPECT_EQ(1, v.atoms.size());
+ EXPECT_EQ(v.atoms[0], "\xde\xadq\xbe\xef");
+
+ v.atom_indices.push_back(0);
+ v.f.AllMatches("foo\xde\xadQ\xbe\xeflemur", v.atom_indices, &v.matches);
+ EXPECT_EQ(1, v.matches.size());
+ EXPECT_EQ(id, v.matches[0]);
+}
+
struct AtomTest {
const char* testname;
// If any test needs more than this many regexps or atoms, increase
« no previous file with comments | « third_party/re2/re2/regexp.cc ('k') | third_party/re2/re2/testing/parse_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698