(t testing.TB, env *Env, expr string, vars any)
| 5232 | } |
| 5233 | |
| 5234 | func interpret(t testing.TB, env *Env, expr string, vars any) (ref.Val, error) { |
| 5235 | t.Helper() |
| 5236 | prg, err := compileOrError(t, env, expr) |
| 5237 | if err != nil { |
| 5238 | return nil, err |
| 5239 | } |
| 5240 | out, _, err := prg.Eval(vars) |
| 5241 | if err != nil { |
| 5242 | return nil, fmt.Errorf("prg.Eval(%v) failed: %v", vars, err) |
| 5243 | } |
| 5244 | return out, nil |
| 5245 | } |
| 5246 | |
| 5247 | func TestExpressionSizeLimitEarlyEnforcement(t *testing.T) { |
| 5248 | env, err := NewEnv(ParserExpressionSizeLimit(1000)) |
no test coverage detected