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

Function TestExpr_optional_chaining_array

expr_test.go:1549–1557  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1547}
1548
1549func TestExpr_optional_chaining_array(t *testing.T) {
1550 env := map[string]any{}
1551 program, err := expr.Compile("foo?.[1]?.[2]?.[3]", expr.Env(env), expr.AllowUndefinedVariables())
1552 require.NoError(t, err)
1553
1554 got, err := expr.Run(program, env)
1555 require.NoError(t, err)
1556 assert.Equal(t, nil, got)
1557}
1558
1559func TestExpr_eval_with_env(t *testing.T) {
1560 _, err := expr.Eval("true", expr.Env(map[string]any{}))

Callers

nothing calls this directly

Calls 6

CompileFunction · 0.92
EnvStruct · 0.92
AllowUndefinedVariablesFunction · 0.92
NoErrorFunction · 0.92
RunFunction · 0.92
EqualFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…