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

Function TestFastCall_OpCallFastErr

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

Source from the content-addressed store, hash-verified

2070}
2071
2072func TestFastCall_OpCallFastErr(t *testing.T) {
2073 env := map[string]any{
2074 "func": func(...any) (any, error) {
2075 return 8, nil
2076 },
2077 }
2078 code := `func("8")`
2079
2080 program, err := expr.Compile(code, expr.Env(env))
2081 assert.NoError(t, err)
2082
2083 out, err := expr.Run(program, env)
2084 assert.NoError(t, err)
2085 assert.Equal(t, 8, out)
2086}
2087
2088func TestRun_custom_func_returns_an_error_as_second_arg(t *testing.T) {
2089 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…