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

Function TestFunctionNoOverloads

cel/decls_test.go:228–236  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

226}
227
228func TestFunctionNoOverloads(t *testing.T) {
229 _, err := NewCustomEnv(
230 Function("right", SingletonBinaryBinding(func(arg1, arg2 ref.Val) ref.Val {
231 return arg2
232 })))
233 if err == nil || !strings.Contains(err.Error(), "must have at least one overload") {
234 t.Errorf("got %v, wanted 'must have at least one overload'", err)
235 }
236}
237
238func TestSingletonUnaryBinding(t *testing.T) {
239 // Test the case where the singleton unary impl is merged with the earlier declaration.

Callers

nothing calls this directly

Calls 5

NewCustomEnvFunction · 0.85
FunctionFunction · 0.70
SingletonBinaryBindingFunction · 0.70
ContainsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected