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

Function TEST

eval/public/cel_function_adapter_test.cc:18–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16namespace {
17
18TEST(CelFunctionAdapterTest, TestAdapterNoArg) {
19 auto func = [](google::protobuf::Arena*) -> int64_t { return 100; };
20 ASSERT_OK_AND_ASSIGN(
21 auto cel_func, (FunctionAdapter<int64_t>::Create("const", false, func)));
22
23 absl::Span<CelValue> args;
24 CelValue result = CelValue::CreateNull();
25 google::protobuf::Arena arena;
26 ASSERT_OK(cel_func->Evaluate(args, &result, &arena));
27 ASSERT_TRUE(result.IsInt64());
28}
29
30TEST(CelFunctionAdapterTest, TestAdapterOneArg) {
31 std::function<int64_t(google::protobuf::Arena*, int64_t)> func =

Callers

nothing calls this directly

Calls 11

IsInt64Method · 0.80
Int64OrDieMethod · 0.80
StringOrDieMethod · 0.80
TimestampOrDieMethod · 0.80
EvaluateMethod · 0.45
sizeMethod · 0.45
valueMethod · 0.45
IsStringMethod · 0.45
receiver_styleMethod · 0.45
nameMethod · 0.45
IsTimestampMethod · 0.45

Tested by

no test coverage detected