(t testing.TB, env *Env, expr string, vars any)
| 4011 | } |
| 4012 | |
| 4013 | func interpret(t testing.TB, env *Env, expr string, vars any) (ref.Val, error) { |
| 4014 | t.Helper() |
| 4015 | prg, err := compileOrError(t, env, expr) |
| 4016 | if err != nil { |
| 4017 | return nil, err |
| 4018 | } |
| 4019 | out, _, err := prg.Eval(vars) |
| 4020 | if err != nil { |
| 4021 | return nil, fmt.Errorf("prg.Eval(%v) failed: %v", vars, err) |
| 4022 | } |
| 4023 | return out, nil |
| 4024 | } |
| 4025 | |
| 4026 | func TestExpressionSizeLimitEarlyEnforcement(t *testing.T) { |
| 4027 | env, err := NewEnv(ParserExpressionSizeLimit(1000)) |
no test coverage detected