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

Function TestIssue584

test/operator/issues584/issues584_test.go:55–73  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

53type Value func(e *Env) float64
54
55func TestIssue584(t *testing.T) {
56 code := `Foo() > 1.5 and Bar() < 200.0`
57
58 p := &Program{}
59
60 opt := []expr.Option{
61 expr.Env(p),
62 expr.Operator("and", "AndCondition", "AndConditions"),
63 expr.Operator(">", "ValueGreaterThan_float"),
64 expr.Operator("<", "ValueLessThan_float"),
65 }
66
67 program, err := expr.Compile(code, opt...)
68 assert.Nil(t, err)
69
70 state, err := expr.Run(program, p)
71 assert.Nil(t, err)
72 assert.NotNil(t, state)
73}

Callers

nothing calls this directly

Calls 6

EnvStruct · 0.92
OperatorFunction · 0.92
CompileFunction · 0.92
NilFunction · 0.92
RunFunction · 0.92
NotNilFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…