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

Function TestIssue857

test/issues/857/issue_test.go:10–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestIssue857(t *testing.T) {
11 foo := map[string]any{
12 "entry": map[string]any{
13 "alpha": "x",
14 "beta": 1,
15 },
16 }
17 bar := map[string]any{
18 "entry": map[string]any{
19 "alpha": "x",
20 "beta": 1,
21 },
22 }
23
24 env := map[string]any{
25 "foo": foo,
26 "bar": bar,
27 }
28
29 code := `
30 foo
31 | keys()
32 | filter(# in bar)
33 | filter(foo[#].alpha == bar[#].alpha)
34 | filter(foo[#].beta == bar[#].beta)
35 `
36
37 _, err := expr.Compile(code, expr.Env(env))
38 require.NoError(t, err)
39}

Callers

nothing calls this directly

Calls 3

CompileFunction · 0.92
EnvStruct · 0.92
NoErrorFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…