MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / TEST_P

Function TEST_P

validator/regex_validator_test.cc:53–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51using MatchesValidatorTest = testing::TestWithParam<TestCase>;
52
53TEST_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
70INSTANTIATE_TEST_SUITE_P(
71 MatchesValidatorTest, MatchesValidatorTest,

Callers

nothing calls this directly

Calls 5

MatchesValidatorFunction · 0.85
AddValidationMethod · 0.80
IsValidMethod · 0.80
FormatErrorMethod · 0.80

Tested by

no test coverage detected