| 1082 | }; |
| 1083 | |
| 1084 | TEST_F(DirectFunctionStepTest, SimpleCall) { |
| 1085 | cel::IntValue(1); |
| 1086 | |
| 1087 | CallExpr call; |
| 1088 | call.set_function(cel::builtin::kAdd); |
| 1089 | call.mutable_args().emplace_back(); |
| 1090 | call.mutable_args().emplace_back(); |
| 1091 | |
| 1092 | std::vector<std::unique_ptr<DirectExpressionStep>> deps; |
| 1093 | deps.push_back(CreateConstValueDirectStep(cel::IntValue(1))); |
| 1094 | deps.push_back(CreateConstValueDirectStep(cel::IntValue(1))); |
| 1095 | |
| 1096 | auto expr = CreateDirectFunctionStep(-1, call, std::move(deps), |
| 1097 | GetOverloads(cel::builtin::kAdd, 2)); |
| 1098 | |
| 1099 | auto plan = CreateExpressionImpl(options_, std::move(expr)); |
| 1100 | |
| 1101 | Activation activation; |
| 1102 | ASSERT_OK_AND_ASSIGN(auto value, plan->Evaluate(activation, &arena_)); |
| 1103 | |
| 1104 | EXPECT_THAT(value, test::IsCelInt64(2)); |
| 1105 | } |
| 1106 | |
| 1107 | TEST_F(DirectFunctionStepTest, RecursiveCall) { |
| 1108 | cel::IntValue(1); |
nothing calls this directly
no test coverage detected