(t testing.TB, env *Env, expr string)
| 4395 | } |
| 4396 | |
| 4397 | func compileOrError(t testing.TB, env *Env, expr string) (Program, error) { |
| 4398 | t.Helper() |
| 4399 | ast, iss := env.Compile(expr) |
| 4400 | if iss.Err() != nil { |
| 4401 | return nil, fmt.Errorf("env.Compile(%s) failed: %v", expr, iss.Err()) |
| 4402 | } |
| 4403 | prg, err := env.Program(ast, EvalOptions(OptOptimize)) |
| 4404 | if err != nil { |
| 4405 | return nil, fmt.Errorf("env.Program() failed: %v", err) |
| 4406 | } |
| 4407 | return prg, nil |
| 4408 | } |
| 4409 | |
| 4410 | func interpret(t testing.TB, env *Env, expr string, vars any) (ref.Val, error) { |
| 4411 | t.Helper() |
no test coverage detected