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

Function TEST

runtime/standard/container_membership_functions_test.cc:43–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 builtin::kIn, builtin::kInDeprecated, builtin::kInFunction};
42
43TEST(RegisterContainerMembershipFunctions, RegistersHomogeneousInOperator) {
44 FunctionRegistry registry;
45 RuntimeOptions options;
46 options.enable_heterogeneous_equality = false;
47
48 ASSERT_OK(RegisterContainerMembershipFunctions(registry, options));
49
50 auto overloads = registry.ListFunctions();
51
52 for (absl::string_view operator_name : kInOperators) {
53 EXPECT_THAT(
54 overloads[operator_name],
55 UnorderedElementsAre(
56 MatchesDescriptor(operator_name, false,
57 std::vector<Kind>{Kind::kInt, Kind::kList}),
58 MatchesDescriptor(operator_name, false,
59 std::vector<Kind>{Kind::kUint, Kind::kList}),
60 MatchesDescriptor(operator_name, false,
61 std::vector<Kind>{Kind::kDouble, Kind::kList}),
62 MatchesDescriptor(operator_name, false,
63 std::vector<Kind>{Kind::kString, Kind::kList}),
64 MatchesDescriptor(operator_name, false,
65 std::vector<Kind>{Kind::kBytes, Kind::kList}),
66 MatchesDescriptor(operator_name, false,
67 std::vector<Kind>{Kind::kBool, Kind::kList}),
68 MatchesDescriptor(operator_name, false,
69 std::vector<Kind>{Kind::kInt, Kind::kMap}),
70 MatchesDescriptor(operator_name, false,
71 std::vector<Kind>{Kind::kUint, Kind::kMap}),
72 MatchesDescriptor(operator_name, false,
73 std::vector<Kind>{Kind::kString, Kind::kMap}),
74 MatchesDescriptor(operator_name, false,
75 std::vector<Kind>{Kind::kBool, Kind::kMap})));
76 }
77}
78
79TEST(RegisterContainerMembershipFunctions, RegistersHeterogeneousInOperation) {
80 FunctionRegistry registry;

Callers

nothing calls this directly

Calls 2

ListFunctionsMethod · 0.45

Tested by

no test coverage detected