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

Function TestOverloadBinaryBindingArgCountMismatch

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

Source from the content-addressed store, hash-verified

714}
715
716func TestOverloadBinaryBindingArgCountMismatch(t *testing.T) {
717 _, err := NewFunction("id",
718 Overload("id_any", []*types.Type{}, types.AnyType,
719 BinaryBinding(func(lhs, rhs ref.Val) ref.Val {
720 return lhs
721 }),
722 ),
723 )
724 if err == nil || !strings.Contains(err.Error(), "non-binary overload") {
725 t.Errorf("NewFunction() got %v, wanted non-binary overload", err)
726 }
727}
728
729func TestOverloadBinaryBindingRedefinition(t *testing.T) {
730 _, err := NewFunction("right",

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected