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

Function TEST_P

validator/timestamp_literal_validator_test.cc:105–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103 testing::TestWithParam<TestCase>;
104
105TEST_P(TimestampLiteralValidatorParameterizedTest, Validate) {
106 const auto& test_case = GetParam();
107 Validator validator;
108 validator.AddValidation(TimestampLiteralValidator());
109 validator.AddValidation(DurationLiteralValidator());
110
111 ASSERT_OK_AND_ASSIGN(auto compiler, StdLibCompiler());
112 ASSERT_OK_AND_ASSIGN(auto result, compiler->Compile(test_case.expression));
113 validator.UpdateValidationResult(result);
114
115 EXPECT_EQ(result.IsValid(), test_case.valid);
116 if (!test_case.valid) {
117 EXPECT_THAT(result.FormatError(), HasSubstr(test_case.error_substr));
118 }
119}
120
121INSTANTIATE_TEST_SUITE_P(
122 TimestampLiteralValidatorParameterizedTest,

Callers

nothing calls this directly

Calls 4

AddValidationMethod · 0.80
IsValidMethod · 0.80
FormatErrorMethod · 0.80

Tested by

no test coverage detected