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

Function TestOperator_struct

test/operator/operator_test.go:15–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestOperator_struct(t *testing.T) {
16 env := mock.Env{
17 Time: time.Date(2017, time.October, 23, 18, 30, 0, 0, time.UTC),
18 }
19
20 code := `Time == "2017-10-23"`
21
22 program, err := expr.Compile(code, expr.Env(mock.Env{}), expr.Operator("==", "TimeEqualString"))
23 require.NoError(t, err)
24
25 output, err := expr.Run(program, env)
26 require.NoError(t, err)
27 require.Equal(t, true, output)
28}
29
30func TestOperator_no_env(t *testing.T) {
31 code := `Time == "2017-10-23"`

Callers

nothing calls this directly

Calls 6

CompileFunction · 0.92
EnvStruct · 0.92
OperatorFunction · 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…