(t testing.TB, env *Env, expr string, vars any)
| 4117 | } |
| 4118 | |
| 4119 | func interpret(t testing.TB, env *Env, expr string, vars any) (ref.Val, error) { |
| 4120 | t.Helper() |
| 4121 | prg, err := compileOrError(t, env, expr) |
| 4122 | if err != nil { |
| 4123 | return nil, err |
| 4124 | } |
| 4125 | out, _, err := prg.Eval(vars) |
| 4126 | if err != nil { |
| 4127 | return nil, fmt.Errorf("prg.Eval(%v) failed: %v", vars, err) |
| 4128 | } |
| 4129 | return out, nil |
| 4130 | } |
| 4131 | |
| 4132 | func TestExpressionSizeLimitEarlyEnforcement(t *testing.T) { |
| 4133 | env, err := NewEnv(ParserExpressionSizeLimit(1000)) |
no test coverage detected