| 16 | namespace { |
| 17 | |
| 18 | TEST(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 | |
| 30 | TEST(CelFunctionAdapterTest, TestAdapterOneArg) { |
| 31 | std::function<int64_t(google::protobuf::Arena*, int64_t)> func = |
nothing calls this directly
no test coverage detected