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

Method TestNoMatchingEqualOverload

eval/public/builtin_func_test.cc:129–146  ·  view source on GitHub ↗

Helper method. Looks up in registry and tests for no matching equality overload.

Source from the content-addressed store, hash-verified

127 // Helper method. Looks up in registry and tests for no matching equality
128 // overload.
129 void TestNoMatchingEqualOverload(const CelValue& ref, const CelValue& other) {
130 options_.enable_heterogeneous_equality = false;
131 CelValue eq_value;
132 ASSERT_NO_FATAL_FAILURE(
133 PerformRun(builtin::kEqual, {}, {ref, other}, &eq_value, options_));
134 ASSERT_TRUE(eq_value.IsError())
135 << " for " << CelValue::TypeName(ref.type()) << " and "
136 << CelValue::TypeName(other.type());
137 EXPECT_TRUE(CheckNoMatchingOverloadError(eq_value));
138
139 CelValue ineq_value;
140 ASSERT_NO_FATAL_FAILURE(
141 PerformRun(builtin::kInequal, {}, {ref, other}, &ineq_value, options_));
142 ASSERT_TRUE(ineq_value.IsError())
143 << " for " << CelValue::TypeName(ref.type()) << " and "
144 << CelValue::TypeName(other.type());
145 EXPECT_TRUE(CheckNoMatchingOverloadError(ineq_value));
146 }
147
148 // Helper method. Looks up in registry and tests Type conversions.
149 void TestTypeConverts(absl::string_view operation, const CelValue& ref,

Callers

nothing calls this directly

Calls 3

typeMethod · 0.80
IsErrorMethod · 0.45

Tested by

no test coverage detected