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

Function TestAsyncBindingRedefinition

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

Source from the content-addressed store, hash-verified

1494}
1495
1496func 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
1512func TestSingletonAsyncBindingRedefinition(t *testing.T) {
1513 _, err := NewFunction("async_fn",

Callers

nothing calls this directly

Calls 5

NewFunctionFunction · 0.70
OverloadFunction · 0.70
AsyncBindingFunction · 0.70
ContainsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected