(t testing.TB, env *Env, expr string)
| 4453 | } |
| 4454 | |
| 4455 | func compileOrError(t testing.TB, env *Env, expr string) (Program, error) { |
| 4456 | t.Helper() |
| 4457 | ast, iss := env.Compile(expr) |
| 4458 | if iss.Err() != nil { |
| 4459 | return nil, fmt.Errorf("env.Compile(%s) failed: %v", expr, iss.Err()) |
| 4460 | } |
| 4461 | prg, err := env.Program(ast, EvalOptions(OptOptimize)) |
| 4462 | if err != nil { |
| 4463 | return nil, fmt.Errorf("env.Program() failed: %v", err) |
| 4464 | } |
| 4465 | return prg, nil |
| 4466 | } |
| 4467 | |
| 4468 | func interpret(t testing.TB, env *Env, expr string, vars any) (ref.Val, error) { |
| 4469 | t.Helper() |
no test coverage detected