(t testing.TB, env *Env, expr string)
| 5219 | } |
| 5220 | |
| 5221 | func compileOrError(t testing.TB, env *Env, expr string) (Program, error) { |
| 5222 | t.Helper() |
| 5223 | ast, iss := env.Compile(expr) |
| 5224 | if iss.Err() != nil { |
| 5225 | return nil, fmt.Errorf("env.Compile(%s) failed: %v", expr, iss.Err()) |
| 5226 | } |
| 5227 | prg, err := env.Program(ast, EvalOptions(OptOptimize)) |
| 5228 | if err != nil { |
| 5229 | return nil, fmt.Errorf("env.Program() failed: %v", err) |
| 5230 | } |
| 5231 | return prg, nil |
| 5232 | } |
| 5233 | |
| 5234 | func interpret(t testing.TB, env *Env, expr string, vars any) (ref.Val, error) { |
| 5235 | t.Helper() |
no test coverage detected