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

Function TestOverloadFunctionBindingRedefinition

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

Source from the content-addressed store, hash-verified

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