(t *testing.T)
| 670 | } |
| 671 | |
| 672 | func TestSingletonFunctionBindingRedefinition(t *testing.T) { |
| 673 | _, err := NewFunction("id", |
| 674 | Overload("id_any", []*types.Type{types.AnyType}, types.AnyType), |
| 675 | SingletonFunctionBinding(func(args ...ref.Val) ref.Val { |
| 676 | return args[0] |
| 677 | }, traits.ComparerType), |
| 678 | SingletonFunctionBinding(func(args ...ref.Val) ref.Val { |
| 679 | return args[0] |
| 680 | }, traits.ComparerType), |
| 681 | ) |
| 682 | if err == nil || !strings.Contains(err.Error(), "already has a singleton binding") { |
| 683 | t.Errorf("NewCustomEnv() got %v, wanted already has a singleton binding", err) |
| 684 | } |
| 685 | } |
| 686 | |
| 687 | func TestOverloadUnaryBindingRedefinition(t *testing.T) { |
| 688 | _, err := NewFunction("id", |
nothing calls this directly
no test coverage detected