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

Function Test_valueAddInt

patcher/value/value_test.go:84–95  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

82}
83
84func Test_valueAddInt(t *testing.T) {
85 env := make(map[string]any)
86 env["ValueOne"] = &customInt{1}
87 env["ValueTwo"] = &customInt{2}
88
89 program, err := expr.Compile("ValueOne + ValueTwo", expr.Env(env), ValueGetter)
90 require.NoError(t, err)
91 out, err := vm.Run(program, env)
92
93 require.NoError(t, err)
94 require.Equal(t, 3, out.(int))
95}
96
97func Test_valueUntypedAddInt(t *testing.T) {
98 env := make(map[string]any)

Callers

nothing calls this directly

Calls 5

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