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

Function TestIssue105

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

Source from the content-addressed store, hash-verified

1803}
1804
1805func TestIssue105(t *testing.T) {
1806 type A struct {
1807 Field string
1808 }
1809 type B struct {
1810 Field int
1811 }
1812 type C struct {
1813 A
1814 B
1815 }
1816 type Env struct {
1817 C
1818 }
1819
1820 code := `
1821 A.Field == '' &&
1822 C.A.Field == '' &&
1823 B.Field == 0 &&
1824 C.B.Field == 0
1825 `
1826
1827 _, err := expr.Compile(code, expr.Env(Env{}))
1828 require.NoError(t, err)
1829}
1830
1831func TestIssue_nested_closures(t *testing.T) {
1832 code := `all(1..3, { all(1..3, { # > 0 }) and # > 0 })`

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…