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

Method TestComparison

eval/public/builtin_func_test.cc:112–125  ·  view source on GitHub ↗

Helper method. Looks up in registry and tests comparison operation.

Source from the content-addressed store, hash-verified

110
111 // Helper method. Looks up in registry and tests comparison operation.
112 void TestComparison(absl::string_view operation, const CelValue& ref,
113 const CelValue& other, bool result) {
114 CelValue result_value;
115
116 ASSERT_NO_FATAL_FAILURE(
117 PerformRun(operation, {}, {ref, other}, &result_value));
118
119 ASSERT_EQ(result_value.IsBool(), true)
120 << absl::StrCat(CelValue::TypeName(ref.type()), " ", operation, " ",
121 CelValue::TypeName(other.type()));
122 ASSERT_EQ(result_value.BoolOrDie(), result)
123 << operation << " for " << ref.DebugString() << " with "
124 << other.DebugString();
125 }
126
127 // Helper method. Looks up in registry and tests for no matching equality
128 // overload.

Callers

nothing calls this directly

Calls 4

typeMethod · 0.80
BoolOrDieMethod · 0.80
IsBoolMethod · 0.45
DebugStringMethod · 0.45

Tested by

no test coverage detected