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

Function TEST_P

runtime/standard/logical_functions_test.cc:125–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123};
124
125TEST_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
150INSTANTIATE_TEST_SUITE_P(
151 Cases, LogicalFunctionsTest,

Callers

nothing calls this directly

Calls 5

TestDispatchToFunctionFunction · 0.85
codeMethod · 0.80
messageMethod · 0.80
RegisterLogicalFunctionsFunction · 0.70
okMethod · 0.45

Tested by

no test coverage detected