(t *testing.T)
| 2070 | } |
| 2071 | |
| 2072 | func 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 | |
| 2088 | func TestRun_custom_func_returns_an_error_as_second_arg(t *testing.T) { |
| 2089 | env := map[string]any{ |