• Home
  • Raw
  • Download

Lines Matching +full:escape +full:- +full:string +full:- +full:regexp

2 // Use of this source code is governed by a BSD-style
7 // Each test picks an alphabet (e.g., "abc"), a maximum string length,
10 // it tries every possible regular expression and string, verifying that
35 static char* escape(const StringPiece& sp) { in escape() function
41 LOG(FATAL) << "ExhaustiveTester escape: too long"; in escape()
59 printf("-"); in PrintResult()
66 printf("-"); in PrintResult()
68 printf("%td-%td", in PrintResult()
69 m[i].begin() - input.begin(), m[i].end() - input.begin()); in PrintResult()
73 // Processes a single generated regexp.
74 // Compiles it using Regexp interface and PCRE, and then
76 void ExhaustiveTester::HandleRegexp(const string& const_regexp) { in HandleRegexp()
78 string regexp = const_regexp; in HandleRegexp() local
80 regexp = StringPrintf(topwrapper_.c_str(), regexp.c_str()); in HandleRegexp()
83 printf("\r%s", regexp.c_str()); in HandleRegexp()
89 // other implementations, such as Go's regexp package. in HandleRegexp()
96 printf("%s\n", escape(strgen_.Next())); in HandleRegexp()
99 printf("%s\n", escape(regexp)); in HandleRegexp()
101 RE2 re(regexp); in HandleRegexp()
104 RE2 relongest(regexp, longest); in HandleRegexp()
124 Tester tester(regexp); in HandleRegexp()
145 const std::vector<string>& alphabet, in ExhaustiveTest()
146 const std::vector<string>& ops, in ExhaustiveTest()
148 const std::vector<string>& stralphabet, in ExhaustiveTest()
149 const string& wrapper, in ExhaustiveTest()
150 const string& topwrapper) { in ExhaustiveTest()
153 maxatoms--; in ExhaustiveTest()
155 maxops--; in ExhaustiveTest()
157 maxstrlen--; in ExhaustiveTest()
172 void EgrepTest(int maxatoms, int maxops, const string& alphabet, in EgrepTest()
173 int maxstrlen, const string& stralphabet, in EgrepTest()
174 const string& wrapper) { in EgrepTest()