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

Function TEST_P

validator/comprehension_nesting_validator_test.cc:54–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52using ComprehensionNestingValidatorTest = testing::TestWithParam<TestCase>;
53
54TEST_P(ComprehensionNestingValidatorTest, Validate) {
55 const auto& test_case = GetParam();
56 Validator validator;
57 validator.AddValidation(ComprehensionNestingLimitValidator(test_case.limit));
58
59 ASSERT_OK_AND_ASSIGN(auto compiler, StdLibCompiler());
60 auto result_or = compiler->Compile(test_case.expression);
61 if (!result_or.ok()) {
62 GTEST_SKIP() << "Expression failed to compile: " << test_case.expression
63 << " " << result_or.status().message();
64 }
65 auto result = std::move(result_or).value();
66
67 validator.UpdateValidationResult(result);
68
69 EXPECT_EQ(result.IsValid(), test_case.valid)
70 << "Expression: " << test_case.expression
71 << " Limit: " << test_case.limit;
72 if (!test_case.valid) {
73 EXPECT_THAT(result.FormatError(), HasSubstr(test_case.error_substr));
74 }
75}
76
77INSTANTIATE_TEST_SUITE_P(
78 ComprehensionNestingValidatorTest, ComprehensionNestingValidatorTest,

Callers

nothing calls this directly

Calls 9

AddValidationMethod · 0.80
messageMethod · 0.80
IsValidMethod · 0.80
FormatErrorMethod · 0.80
CompileMethod · 0.45
okMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected