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

Function TestOverloadFunctionBindingWithLateBinding

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

Source from the content-addressed store, hash-verified

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