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

Function TestIssue730

test/issues/730/issue_test.go:20–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

18}
19
20func TestIssue730(t *testing.T) {
21 code := `int(Mode) == 1`
22
23 tmp := ModeEnumA
24
25 env := map[string]any{
26 "Mode": &tmp,
27 }
28
29 program, err := expr.Compile(code, expr.Env(env))
30 require.NoError(t, err)
31
32 output, err := expr.Run(program, env)
33 require.NoError(t, err)
34 require.True(t, output.(bool))
35}
36
37func TestIssue730_warn_about_different_types(t *testing.T) {
38 code := `Mode == 1`

Callers

nothing calls this directly

Calls 5

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