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

Function TEST_P

validator/homogeneous_literal_validator_test.cc:63–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61using HomogeneousLiteralValidatorTest = testing::TestWithParam<TestCase>;
62
63TEST_P(HomogeneousLiteralValidatorTest, Validate) {
64 const auto& test_case = GetParam();
65 Validator validator;
66 validator.AddValidation(HomogeneousLiteralValidator());
67
68 ASSERT_OK_AND_ASSIGN(auto compiler, StdLibCompiler());
69 ASSERT_OK_AND_ASSIGN(auto result, compiler->Compile(test_case.expression));
70 validator.UpdateValidationResult(result);
71
72 EXPECT_EQ(result.IsValid(), test_case.valid);
73 if (!test_case.valid) {
74 EXPECT_THAT(result.FormatError(), HasSubstr(test_case.error_substr));
75 }
76}
77
78INSTANTIATE_TEST_SUITE_P(
79 HomogeneousLiteralValidatorTest, HomogeneousLiteralValidatorTest,

Callers

nothing calls this directly

Calls 5

AddValidationMethod · 0.80
IsValidMethod · 0.80
FormatErrorMethod · 0.80

Tested by

no test coverage detected