| 123 | }; |
| 124 | |
| 125 | TEST_P(LogicalFunctionsTest, Runner) { |
| 126 | const TestCase& test_case = GetParam(); |
| 127 | cel::FunctionRegistry registry; |
| 128 | |
| 129 | ASSERT_OK(RegisterLogicalFunctions(registry, RuntimeOptions())); |
| 130 | |
| 131 | std::vector<Value> args = test_case.arguments(); |
| 132 | |
| 133 | absl::StatusOr<Value> result = TestDispatchToFunction( |
| 134 | registry, test_case.function, args, |
| 135 | cel::internal::GetTestingDescriptorPool(), |
| 136 | cel::internal::GetTestingMessageFactory(), &arena_); |
| 137 | |
| 138 | EXPECT_EQ(result.ok(), test_case.result_matcher.ok()); |
| 139 | |
| 140 | if (!test_case.result_matcher.ok()) { |
| 141 | EXPECT_EQ(result.status().code(), test_case.result_matcher.status().code()); |
| 142 | EXPECT_THAT(result.status().message(), |
| 143 | HasSubstr(test_case.result_matcher.status().message())); |
| 144 | } else { |
| 145 | ASSERT_TRUE(result.ok()) << "unexpected error" << result.status(); |
| 146 | EXPECT_THAT(*result, *test_case.result_matcher); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | INSTANTIATE_TEST_SUITE_P( |
| 151 | Cases, LogicalFunctionsTest, |
nothing calls this directly
no test coverage detected