(t testing.TB, env *Env, expr string, vars any)
| 4408 | } |
| 4409 | |
| 4410 | func interpret(t testing.TB, env *Env, expr string, vars any) (ref.Val, error) { |
| 4411 | t.Helper() |
| 4412 | prg, err := compileOrError(t, env, expr) |
| 4413 | if err != nil { |
| 4414 | return nil, err |
| 4415 | } |
| 4416 | out, _, err := prg.Eval(vars) |
| 4417 | if err != nil { |
| 4418 | return nil, fmt.Errorf("prg.Eval(%v) failed: %v", vars, err) |
| 4419 | } |
| 4420 | return out, nil |
| 4421 | } |
| 4422 | |
| 4423 | func TestExpressionSizeLimitEarlyEnforcement(t *testing.T) { |
| 4424 | env, err := NewEnv(ParserExpressionSizeLimit(1000)) |
no test coverage detected