MCPcopy
hub / github.com/expr-lang/expr / TestCompile_call_on_nil

Function TestCompile_call_on_nil

compiler/compiler_test.go:671–678  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

669}
670
671func TestCompile_call_on_nil(t *testing.T) {
672 env := map[string]any{
673 "foo": nil,
674 }
675 _, err := expr.Compile(`foo()`, expr.Env(env))
676 require.Error(t, err)
677 require.Contains(t, err.Error(), "foo is nil; cannot call nil as function")
678}
679
680func TestCompile_Expect(t *testing.T) {
681 tests := []struct {

Callers

nothing calls this directly

Calls 5

CompileFunction · 0.92
EnvStruct · 0.92
ErrorFunction · 0.92
ContainsFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…