(t *testing.T)
| 844 | } |
| 845 | |
| 846 | func TestCompileYAMLPolicy_ConditionAlwaysFalse(t *testing.T) { |
| 847 | policySource := `name: condition_always_false |
| 848 | rule: |
| 849 | aggregate: |
| 850 | - condition: 'false' |
| 851 | output: "'foo'"` |
| 852 | _, _, iss := parseAndCompilePolicy(t, "condition_always_false", policySource, nil, nil) |
| 853 | if iss.Err() == nil { |
| 854 | t.Fatalf("Compile() succeeded, wanted error") |
| 855 | } |
| 856 | if !strings.Contains(iss.Err().Error(), "Condition is always false") { |
| 857 | t.Errorf("Compile() got %v, wanted 'Condition is always false'", iss.Err()) |
| 858 | } |
| 859 | } |
nothing calls this directly
no test coverage detected