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

Function TestRun_InnerMethodWithError_NilSafe

vm/vm_test.go:254–268  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

252}
253
254func TestRun_InnerMethodWithError_NilSafe(t *testing.T) {
255 input := `InnerEnv?.WillError("yes")`
256
257 tree, err := parser.Parse(input)
258 require.NoError(t, err)
259
260 env := ErrorEnv{}
261 funcConf := conf.New(env)
262 program, err := compiler.Compile(tree, funcConf)
263 require.NoError(t, err)
264
265 out, err := vm.Run(program, env)
266 require.EqualError(t, err, "inner error (1:11)\n | InnerEnv?.WillError(\"yes\")\n | ..........^")
267 require.Equal(t, nil, out)
268}
269
270func TestRun_TaggedFieldName(t *testing.T) {
271 input := `value`

Callers

nothing calls this directly

Calls 7

ParseFunction · 0.92
NoErrorFunction · 0.92
NewFunction · 0.92
CompileFunction · 0.92
RunFunction · 0.92
EqualErrorFunction · 0.92
EqualFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…