(t *testing.T)
| 584 | } |
| 585 | |
| 586 | func TestFunctionAddCollidingOverloads(t *testing.T) { |
| 587 | _, err := NewFunction("max", |
| 588 | Overload("max_int", []*types.Type{types.IntType}, types.IntType), |
| 589 | Overload("max_int2", []*types.Type{types.IntType}, types.IntType), |
| 590 | ) |
| 591 | if err == nil || !strings.Contains(err.Error(), "max_int collides with max_int2") { |
| 592 | t.Fatalf("NewFunction() got %v, wanted collision error", err) |
| 593 | } |
| 594 | } |
| 595 | |
| 596 | func TestFunctionNoOverloads(t *testing.T) { |
| 597 | _, err := NewFunction("right", SingletonBinaryBinding(func(arg1, arg2 ref.Val) ref.Val { |
nothing calls this directly
no test coverage detected