(t *testing.T)
| 163 | } |
| 164 | |
| 165 | func TestMaxNestedExpressions_Error(t *testing.T) { |
| 166 | policyName := "limits" |
| 167 | wantError := `ERROR: testdata/limits/policy.yaml:15:8: error configuring compiler option: nested expression limit must be non-negative, non-zero value: -1 |
| 168 | | name: "limits" |
| 169 | | .......^` |
| 170 | policy := parsePolicy(t, policyName, []ParserOption{}) |
| 171 | _, _, iss := compile(t, policyName, policy, []cel.EnvOption{}, []CompilerOption{MaxNestedExpressions(-1)}) |
| 172 | if iss.Err() == nil { |
| 173 | t.Fatalf("compile(%s) did not error, wanted %s", policyName, wantError) |
| 174 | } |
| 175 | if iss.Err().Error() != wantError { |
| 176 | t.Errorf("compile(%s) got error %s, wanted %s", policyName, iss.Err().Error(), wantError) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | func TestWhitespaceHanlding(t *testing.T) { |
| 181 |
nothing calls this directly
no test coverage detected