(t *testing.T)
| 149 | } |
| 150 | |
| 151 | func TestWriteAlertWarning(t *testing.T) { |
| 152 | alert := &extcs.Alert{Provider: "regex", MatchedRules: []string{"r1", "r2"}} |
| 153 | var buf bytes.Buffer |
| 154 | WriteAlertWarning(&buf, alert) |
| 155 | got := buf.String() |
| 156 | if !strings.Contains(got, "r1") || !strings.Contains(got, "r2") { |
| 157 | t.Errorf("warning should contain rule IDs, got: %s", got) |
| 158 | } |
| 159 | } |
nothing calls this directly
no test coverage detected