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

Function BuilderForNameResolutionTest

eval/compiler/flat_expr_builder_test.cc:1506–1518  ·  view source on GitHub ↗

Builder with google.api.expr.runtime.TestMessage and TestEnum types linked in and the standard functions registered.

Source from the content-addressed store, hash-verified

1504// Builder with google.api.expr.runtime.TestMessage and TestEnum types
1505// linked in and the standard functions registered.
1506CelExpressionBuilderFlatImpl BuilderForNameResolutionTest(
1507 absl::string_view container) {
1508 cel::RuntimeOptions options;
1509 options.enable_qualified_type_identifiers = true;
1510
1511 CelExpressionBuilderFlatImpl builder(NewTestingRuntimeEnv(), options);
1512 builder.GetTypeRegistry()->Register(TestMessage::TestEnum_descriptor());
1513 builder.GetTypeRegistry()->Register(TestEnum_descriptor());
1514 builder.set_container(std::string(container));
1515 ABSL_CHECK_OK(cel::RegisterStandardFunctions(
1516 builder.GetRegistry()->InternalGetRegistry(), options));
1517 return builder;
1518}
1519
1520TEST(FlatExprBuilderTest, ShortEnumResolution) {
1521 google::protobuf::Arena arena;

Callers 1

TESTFunction · 0.85

Calls 5

GetTypeRegistryMethod · 0.80
GetRegistryMethod · 0.80
RegisterMethod · 0.45
set_containerMethod · 0.45

Tested by

no test coverage detected