| 67 | }; |
| 68 | |
| 69 | TEST_P(CelExpressionBuilderFlatImplComprehensionsTest, NestedComp) { |
| 70 | cel::RuntimeOptions options = GetRuntimeOptions(); |
| 71 | CelExpressionBuilderFlatImpl builder(NewTestingRuntimeEnv(), options); |
| 72 | |
| 73 | ASSERT_OK_AND_ASSIGN(auto parsed_expr, |
| 74 | parser::Parse("[1, 2].filter(x, [3, 4].all(y, x < y))")); |
| 75 | ASSERT_OK(RegisterBuiltinFunctions(builder.GetRegistry())); |
| 76 | ASSERT_OK_AND_ASSIGN(auto cel_expr, |
| 77 | builder.CreateExpression(&parsed_expr.expr(), |
| 78 | &parsed_expr.source_info())); |
| 79 | |
| 80 | Activation activation; |
| 81 | google::protobuf::Arena arena; |
| 82 | ASSERT_OK_AND_ASSIGN(CelValue result, cel_expr->Evaluate(activation, &arena)); |
| 83 | ASSERT_TRUE(result.IsList()); |
| 84 | EXPECT_THAT(*result.ListOrDie(), testing::SizeIs(2)); |
| 85 | } |
| 86 | |
| 87 | TEST_P(CelExpressionBuilderFlatImplComprehensionsTest, MapComp) { |
| 88 | cel::RuntimeOptions options = GetRuntimeOptions(); |
nothing calls this directly
no test coverage detected