| 147 | }; |
| 148 | |
| 149 | TEST_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 | |
| 190 | TEST_P(TestRunnerParamTest, BasicTestReportsFailure) { |
| 191 | ASSERT_OK_AND_ASSIGN(cel::ValidationResult validation_result, |
nothing calls this directly
no test coverage detected