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

Function TestOverloadFunctionBindingWithLateBinding

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

Source from the content-addressed store, hash-verified

785}
786
787func TestOverloadFunctionBindingWithLateBinding(t *testing.T) {
788 _, err := NewFunction("id",
789 Overload("id_bool", []*types.Type{types.BoolType}, types.AnyType, FunctionBinding(func(args ...ref.Val) ref.Val {
790 return args[0]
791 }), LateFunctionBinding()),
792 )
793 if err == nil || !strings.Contains(err.Error(), "already has a binding") {
794 t.Errorf("NewCustomEnv() got %v, wanted already has a binding", err)
795 }
796}
797
798func TestOverloadFunctionLateBindingWithBinding(t *testing.T) {
799 _, err := NewFunction("id",

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected