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

Function TEST_P

testing/testrunner/runner_lib_test.cc:149–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147};
148
149TEST_P(TestRunnerParamTest, BasicTestReportsSuccess) {
150 ASSERT_OK_AND_ASSIGN(
151 cel::ValidationResult validation_result,
152 DefaultCompiler().Compile("{'sum': x + y, 'literal': 3}"));
153 CheckedExpr checked_expr;
154 ASSERT_THAT(cel::AstToCheckedExpr(*validation_result.GetAst(), &checked_expr),
155 absl_testing::IsOk());
156 TestCase test_case = ParseTextProtoOrDie<TestCase>(R"pb(
157 input {
158 key: "x"
159 value { value { int64_value: 1 } }
160 }
161 input {
162 key: "y"
163 value { value { int64_value: 2 } }
164 }
165 output {
166 result_value {
167 map_value {
168 entries {
169 key { string_value: "literal" }
170 value { int64_value: 3 }
171 }
172 entries {
173 key { string_value: "sum" }
174 value { int64_value: 3 }
175 }
176 }
177 }
178 }
179 )pb");
180 ASSERT_OK_AND_ASSIGN(std::unique_ptr<CelTestContext> context,
181 CreateTestContext());
182
183 context->SetExpressionSource(
184 CelExpressionSource::FromCheckedExpr(std::move(checked_expr)));
185
186 TestRunner test_runner(std::move(context));
187 EXPECT_NO_FATAL_FAILURE(test_runner.RunTest(test_case));
188}
189
190TEST_P(TestRunnerParamTest, BasicTestReportsFailure) {
191 ASSERT_OK_AND_ASSIGN(cel::ValidationResult validation_result,

Callers

nothing calls this directly

Calls 11

AstToCheckedExprFunction · 0.85
CreateBasicCompilerFunction · 0.85
GetAstMethod · 0.80
SetExpressionSourceMethod · 0.80
RunTestMethod · 0.80
SetCompilerMethod · 0.80
SetCustomBindingsMethod · 0.80
TESTFunction · 0.70
ASSERT_OK_AND_ASSIGNFunction · 0.50
emptyMethod · 0.45
CompileMethod · 0.45

Tested by

no test coverage detected