MCPcopy Create free account
hub / github.com/expr-lang/expr / TestIssue854

Function TestIssue854

test/issues/854/issue_test.go:11–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestIssue854(t *testing.T) {
12 envType := types.Map{
13 "user": types.Map{
14 // If we do not specify `Profile` here,
15 // this is a correct behavior to throw
16 // on a missing property.
17 },
18 }
19
20 code := `user.Profile?.Address ?? "Unknown address"`
21
22 _, err := expr.Compile(code, expr.Env(envType))
23 require.Error(t, err)
24}

Callers

nothing calls this directly

Calls 3

CompileFunction · 0.92
EnvStruct · 0.92
ErrorFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…