MCPcopy
hub / github.com/expr-lang/expr / TestFastCall

Function TestFastCall

expr_test.go:2056–2070  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2054}
2055
2056func TestFastCall(t *testing.T) {
2057 env := map[string]any{
2058 "func": func(in any) float64 {
2059 return 8
2060 },
2061 }
2062 code := `func("8")`
2063
2064 program, err := expr.Compile(code, expr.Env(env))
2065 assert.NoError(t, err)
2066
2067 out, err := expr.Run(program, env)
2068 assert.NoError(t, err)
2069 assert.Equal(t, float64(8), out)
2070}
2071
2072func TestFastCall_OpCallFastErr(t *testing.T) {
2073 env := 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…