Go to the documentation of this file.
11 #include "util/test.h"
12 #include "util/flags.h"
13 #include "re2/testing/exhaustive_tester.h"
15 DEFINE_FLAG(
int, regexpseed, 404,
"Random regexp seed.");
16 DEFINE_FLAG(
int, regexpcount, 100,
"How many random regexps to generate.");
17 DEFINE_FLAG(
int, stringseed, 200,
"Random string seed.");
18 DEFINE_FLAG(
int, stringcount, 100,
"How many random strings to generate.");
26 const std::vector<std::string>&
alphabet,
27 const std::vector<std::string>&
ops,
29 const std::vector<std::string>& stralphabet,
40 maxstrlen, stralphabet,
wrapper,
"");
41 t.RandomStrings(
GetFlag(FLAGS_stringseed),
43 t.GenerateRandom(
GetFlag(FLAGS_regexpseed),
45 printf(
"%d regexps, %d tests, %d failures [%d/%d str]\n",
46 t.regexps(), t.tests(), t.failures(), maxstrlen, (
int)stralphabet.size());
85 std::vector<std::string>
ops =
Split(
" ",
86 "%s%s %s|%s %s* %s*? %s+ %s+? %s? %s?? "
87 "%s{0} %s{0,} %s{1} %s{1,} %s{0,1} %s{0,2} %s{1,2} "
88 "%s{2} %s{2,} %s{3,4} %s{4,5}");
93 std::vector<std::string> atoms =
Split(
" ",
94 ". (?:^) (?:$) \\a \\f \\n \\r \\t \\v "
95 "\\d \\D \\s \\S \\w \\W (?:\\b) (?:\\B) "
97 std::vector<std::string>
alphabet =
Explode(
"abc123\001\002\003\t\r\n\v\f\a");
std::vector< std::string > Split(const StringPiece &sep, const StringPiece &s)
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
static void RandomTest(int maxatoms, int maxops, const std::vector< std::string > &alphabet, const std::vector< std::string > &ops, int maxstrlen, const std::vector< std::string > &stralphabet, const std::string &wrapper)
static const char alphabet[]
grpc_channel_wrapper * wrapper
static const std::vector< std::string > & EgrepOps()
std::vector< std::string > Explode(const StringPiece &s)
DEFINE_FLAG(int, regexpseed, 404, "Random regexp seed.")
const bool RE2_DEBUG_MODE
static int Random(uint32_t *state)
TEST(TestCharClassBuilder, Adds)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:50