11 #include "util/test.h"
12 #include "re2/testing/exhaustive_tester.h"
15 DEFINE_int32(regexpcount, 100,
"How many random regexps to generate.");
17 DEFINE_int32(stringcount, 100,
"How many random strings to generate.");
25 const std::vector<std::string>&
alphabet,
26 const std::vector<std::string>&
ops,
28 const std::vector<std::string>& stralphabet,
39 maxstrlen, stralphabet,
wrapper,
"");
40 t.RandomStrings(FLAGS_stringseed, FLAGS_stringcount);
41 t.GenerateRandom(FLAGS_regexpseed, FLAGS_regexpcount);
42 printf(
"%d regexps, %d tests, %d failures [%d/%d str]\n",
43 t.regexps(), t.tests(), t.failures(), maxstrlen, (
int)stralphabet.size());
82 std::vector<std::string>
ops =
Split(
" ",
83 "%s%s %s|%s %s* %s*? %s+ %s+? %s? %s?? "
84 "%s{0} %s{0,} %s{1} %s{1,} %s{0,1} %s{0,2} %s{1,2} "
85 "%s{2} %s{2,} %s{3,4} %s{4,5}");
90 std::vector<std::string> atoms =
Split(
" ",
91 ". (?:^) (?:$) \\a \\f \\n \\r \\t \\v "
92 "\\d \\D \\s \\S \\w \\W (?:\\b) (?:\\B) "
94 std::vector<std::string>
alphabet =
Explode(
"abc123\001\002\003\t\r\n\v\f\a");