| 744 | &TestNameFn); |
| 745 | |
| 746 | TEST(FunctionStepTestUnknownFunctionResults, CaptureArgs) { |
| 747 | ExecutionPath path; |
| 748 | CelFunctionRegistry registry; |
| 749 | |
| 750 | ASSERT_OK(registry.Register( |
| 751 | std::make_unique<ConstFunction>(CelValue::CreateInt64(2), "Const2"))); |
| 752 | ASSERT_OK(registry.Register( |
| 753 | std::make_unique<ConstFunction>(CelValue::CreateInt64(3), "Const3"))); |
| 754 | ASSERT_OK(registry.Register( |
| 755 | std::make_unique<AddFunction>(ShouldReturnUnknown::kYes))); |
| 756 | |
| 757 | CallExpr call1 = ConstFunction::MakeCall("Const2"); |
| 758 | CallExpr call2 = ConstFunction::MakeCall("Const3"); |
| 759 | CallExpr add_call = AddFunction::MakeCall(); |
| 760 | |
| 761 | ASSERT_OK_AND_ASSIGN(auto step0, MakeTestFunctionStep(call1, registry)); |
| 762 | ASSERT_OK_AND_ASSIGN(auto step1, MakeTestFunctionStep(call2, registry)); |
| 763 | ASSERT_OK_AND_ASSIGN(auto step2, MakeTestFunctionStep(add_call, registry)); |
| 764 | |
| 765 | path.push_back(std::move(step0)); |
| 766 | path.push_back(std::move(step1)); |
| 767 | path.push_back(std::move(step2)); |
| 768 | cel::RuntimeOptions options; |
| 769 | options.unknown_processing = |
| 770 | cel::UnknownProcessingOptions::kAttributeAndFunction; |
| 771 | auto env = NewTestingRuntimeEnv(); |
| 772 | CelExpressionFlatImpl impl( |
| 773 | env, |
| 774 | FlatExpression(std::move(path), |
| 775 | /*comprehension_slot_count=*/0, |
| 776 | env->type_registry.GetComposedTypeProvider(), options)); |
| 777 | |
| 778 | Activation activation; |
| 779 | google::protobuf::Arena arena; |
| 780 | |
| 781 | ASSERT_OK_AND_ASSIGN(CelValue value, impl.Evaluate(activation, &arena)); |
| 782 | ASSERT_TRUE(value.IsUnknownSet()); |
| 783 | } |
| 784 | |
| 785 | TEST(FunctionStepTestUnknownFunctionResults, MergeDownCaptureArgs) { |
| 786 | ExecutionPath path; |
nothing calls this directly
no test coverage detected