(t *testing.T)
| 1494 | } |
| 1495 | |
| 1496 | func TestAsyncBindingRedefinition(t *testing.T) { |
| 1497 | _, err := NewFunction("async_fn", |
| 1498 | Overload("async_fn_int", []*types.Type{types.IntType}, types.IntType, |
| 1499 | AsyncBinding(func(ctx context.Context, args ...ref.Val) ref.Val { |
| 1500 | return args[0] |
| 1501 | }), |
| 1502 | AsyncBinding(func(ctx context.Context, args ...ref.Val) ref.Val { |
| 1503 | return args[0] |
| 1504 | }), |
| 1505 | ), |
| 1506 | ) |
| 1507 | if err == nil || !strings.Contains(err.Error(), "already has a binding") { |
| 1508 | t.Errorf("NewFunction() got %v, wanted already has a binding", err) |
| 1509 | } |
| 1510 | } |
| 1511 | |
| 1512 | func TestSingletonAsyncBindingRedefinition(t *testing.T) { |
| 1513 | _, err := NewFunction("async_fn", |
nothing calls this directly
no test coverage detected