| 896 | } |
| 897 | |
| 898 | void SearchBitState(benchmark::State& state, const char* regexp, |
| 899 | const StringPiece& text, Prog::Anchor anchor, |
| 900 | bool expect_match) { |
| 901 | for (auto _ : state) { |
| 902 | Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL); |
| 903 | CHECK(re); |
| 904 | Prog* prog = re->CompileToProg(0); |
| 905 | CHECK(prog); |
| 906 | CHECK(prog->CanBitState()); |
| 907 | CHECK_EQ(prog->SearchBitState(text, text, anchor, Prog::kFirstMatch, NULL, 0), |
| 908 | expect_match); |
| 909 | delete prog; |
| 910 | re->Decref(); |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | void SearchPCRE(benchmark::State& state, const char* regexp, |
| 915 | const StringPiece& text, Prog::Anchor anchor, |
nothing calls this directly
no test coverage detected