(t *testing.T)
| 117 | } |
| 118 | |
| 119 | func TestMaxNestedExpressions_Error(t *testing.T) { |
| 120 | policyName := "limits" |
| 121 | wantError := `ERROR: testdata/limits/policy.yaml:15:8: error configuring compiler option: nested expression limit must be non-negative, non-zero value: -1 |
| 122 | | name: "limits" |
| 123 | | .......^` |
| 124 | policy := parsePolicy(t, policyName, []ParserOption{}) |
| 125 | _, _, iss := compile(t, policyName, policy, []cel.EnvOption{}, []CompilerOption{MaxNestedExpressions(-1)}) |
| 126 | if iss.Err() == nil { |
| 127 | t.Fatalf("compile(%s) did not error, wanted %s", policyName, wantError) |
| 128 | } |
| 129 | if iss.Err().Error() != wantError { |
| 130 | t.Errorf("compile(%s) got error %s, wanted %s", policyName, iss.Err().Error(), wantError) |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | func TestWhitespaceHanlding(t *testing.T) { |
| 135 |
nothing calls this directly
no test coverage detected