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

Function TestOverloadFunctionBindingRedefinition

common/decls/decls_test.go:745–759  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

743}
744
745func TestOverloadFunctionBindingRedefinition(t *testing.T) {
746 _, err := NewFunction("id",
747 Overload("id_any", []*types.Type{types.AnyType}, types.AnyType,
748 FunctionBinding(func(args ...ref.Val) ref.Val {
749 return args[0]
750 }),
751 FunctionBinding(func(args ...ref.Val) ref.Val {
752 return args[0]
753 }),
754 ),
755 )
756 if err == nil || !strings.Contains(err.Error(), "already has a binding") {
757 t.Errorf("NewCustomEnv() got %v, wanted already has a binding", err)
758 }
759}
760
761func TestOverloadFunctionLateBinding(t *testing.T) {
762 function, err := NewFunction("id",

Callers

nothing calls this directly

Calls 5

NewFunctionFunction · 0.70
OverloadFunction · 0.70
FunctionBindingFunction · 0.70
ContainsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected