| 51 | using MatchesValidatorTest = testing::TestWithParam<TestCase>; |
| 52 | |
| 53 | TEST_P(MatchesValidatorTest, Validate) { |
| 54 | const auto& test_case = GetParam(); |
| 55 | Validator validator; |
| 56 | validator.AddValidation(MatchesValidator()); |
| 57 | |
| 58 | ASSERT_OK_AND_ASSIGN(auto compiler, StdLibCompiler()); |
| 59 | ASSERT_OK_AND_ASSIGN(auto result, compiler->Compile(test_case.expression)); |
| 60 | |
| 61 | validator.UpdateValidationResult(result); |
| 62 | |
| 63 | EXPECT_EQ(result.IsValid(), test_case.valid) |
| 64 | << "Expression: " << test_case.expression; |
| 65 | if (!test_case.valid) { |
| 66 | EXPECT_THAT(result.FormatError(), HasSubstr(test_case.error_substr)); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | INSTANTIATE_TEST_SUITE_P( |
| 71 | MatchesValidatorTest, MatchesValidatorTest, |
nothing calls this directly
no test coverage detected