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

Function TestFunctionAddCollidingOverloads

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

Source from the content-addressed store, hash-verified

584}
585
586func 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
596func TestFunctionNoOverloads(t *testing.T) {
597 _, err := NewFunction("right", SingletonBinaryBinding(func(arg1, arg2 ref.Val) ref.Val {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected