(t testing.TB, env *Env, expr string)
| 3998 | } |
| 3999 | |
| 4000 | func compileOrError(t testing.TB, env *Env, expr string) (Program, error) { |
| 4001 | t.Helper() |
| 4002 | ast, iss := env.Compile(expr) |
| 4003 | if iss.Err() != nil { |
| 4004 | return nil, fmt.Errorf("env.Compile(%s) failed: %v", expr, iss.Err()) |
| 4005 | } |
| 4006 | prg, err := env.Program(ast, EvalOptions(OptOptimize)) |
| 4007 | if err != nil { |
| 4008 | return nil, fmt.Errorf("env.Program() failed: %v", err) |
| 4009 | } |
| 4010 | return prg, nil |
| 4011 | } |
| 4012 | |
| 4013 | func interpret(t testing.TB, env *Env, expr string, vars any) (ref.Val, error) { |
| 4014 | t.Helper() |
no test coverage detected