MCPcopy Create free account
hub / github.com/cel-expr/cel-go / TestSingletonBinaryBinding

Function TestSingletonBinaryBinding

cel/decls_test.go:293–307  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

291}
292
293func TestSingletonBinaryBinding(t *testing.T) {
294 _, err := NewCustomEnv(
295 Function("right",
296 Overload("right_int_int", []*Type{IntType, IntType}, IntType),
297 Overload("right_double_double", []*Type{DoubleType, DoubleType}, DoubleType),
298 Overload("right_string_string", []*Type{StringType, StringType}, StringType),
299 SingletonBinaryBinding(func(arg1, arg2 ref.Val) ref.Val {
300 return arg2
301 }, traits.ComparerType),
302 ),
303 )
304 if err != nil {
305 t.Errorf("NewCustomEnv() failed: %v", err)
306 }
307}
308
309func TestSingletonFunctionBinding(t *testing.T) {
310 env, err := NewCustomEnv(

Callers

nothing calls this directly

Calls 4

NewCustomEnvFunction · 0.85
FunctionFunction · 0.70
OverloadFunction · 0.70
SingletonBinaryBindingFunction · 0.70

Tested by

no test coverage detected