| 846 | // Anchored says whether to run an anchored search. |
| 847 | |
| 848 | void SearchDFA(benchmark::State& state, const char* regexp, |
| 849 | const StringPiece& text, Prog::Anchor anchor, |
| 850 | bool expect_match) { |
| 851 | for (auto _ : state) { |
| 852 | Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL); |
| 853 | CHECK(re); |
| 854 | Prog* prog = re->CompileToProg(0); |
| 855 | CHECK(prog); |
| 856 | bool failed = false; |
| 857 | CHECK_EQ(prog->SearchDFA(text, StringPiece(), anchor, Prog::kFirstMatch, |
| 858 | NULL, &failed, NULL), |
| 859 | expect_match); |
| 860 | CHECK(!failed); |
| 861 | delete prog; |
| 862 | re->Decref(); |
| 863 | } |
| 864 | } |
| 865 | |
| 866 | void SearchNFA(benchmark::State& state, const char* regexp, |
| 867 | const StringPiece& text, Prog::Anchor anchor, |
nothing calls this directly
no test coverage detected