(t *testing.T)
| 743 | } |
| 744 | |
| 745 | func 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 | |
| 761 | func TestOverloadFunctionLateBinding(t *testing.T) { |
| 762 | function, err := NewFunction("id", |
nothing calls this directly
no test coverage detected