MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / TestRecursion

Function TestRecursion

extern/re2/re2/testing/re2_test.cc:372–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372static void TestRecursion(int size, const char* pattern) {
373 // Fill up a string repeating the pattern given
374 std::string domain;
375 domain.resize(size);
376 size_t patlen = strlen(pattern);
377 for (int i = 0; i < size; i++) {
378 domain[i] = pattern[i % patlen];
379 }
380 // Just make sure it doesn't crash due to too much recursion.
381 RE2 re("([a-zA-Z0-9]|-)+(\\.([a-zA-Z0-9]|-)+)*(\\.)?", RE2::Quiet);
382 RE2::FullMatch(domain, re);
383}
384
385// A meta-quoted string, interpreted as a pattern, should always match
386// the original unquoted string.

Callers 1

TESTFunction · 0.85

Calls 1

resizeMethod · 0.45

Tested by

no test coverage detected