MCPcopy Index your code
hub / github.com/expr-lang/expr / TestIssue823_EnvMethods

Function TestIssue823_EnvMethods

test/issues/823/issue_test.go:73–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestIssue823_EnvMethods(t *testing.T) {
74 p, err := expr.Compile(
75 "Now2().After(Date2())",
76 expr.Env(&envWithMethods{}),
77 expr.WithContext("ctx"),
78 )
79 require.NoError(t, err)
80
81 r, err := expr.Run(p, &envWithMethods{Ctx: context.Background()})
82 require.NoError(t, err)
83 require.True(t, r.(bool))
84}

Callers

nothing calls this directly

Calls 6

CompileFunction · 0.92
EnvStruct · 0.92
WithContextFunction · 0.92
NoErrorFunction · 0.92
RunFunction · 0.92
TrueFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…