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

Function TEST_P

eval/compiler/flat_expr_builder_comprehensions_test.cc:69–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67};
68
69TEST_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
87TEST_P(CelExpressionBuilderFlatImplComprehensionsTest, MapComp) {
88 cel::RuntimeOptions options = GetRuntimeOptions();

Callers

nothing calls this directly

Calls 15

RegisterBuiltinFunctionsFunction · 0.85
EqualsCelValueFunction · 0.85
IsCelBoolFunction · 0.85
GetRegistryMethod · 0.80
ListOrDieMethod · 0.80
InsertValueMethod · 0.80
IsUnknownSetMethod · 0.80
UnknownSetOrDieMethod · 0.80

Tested by

no test coverage detected