--------------------------------------------------------------------------- Severity tests ---------------------------------------------------------------------------
(t *testing.T)
| 191 | // --------------------------------------------------------------------------- |
| 192 | |
| 193 | func TestLint_DefaultSeverityIsError(t *testing.T) { |
| 194 | linter := newDefaultLinter(t) |
| 195 | result, err := linter.ParseAndLint("unknown: some message here") |
| 196 | if err != nil { |
| 197 | t.Fatalf("unexpected error: %v", err) |
| 198 | } |
| 199 | if len(result.Issues()) == 0 { |
| 200 | t.Fatal("expected at least one issue") |
| 201 | } |
| 202 | for _, iss := range result.Issues() { |
| 203 | if iss.Severity() != lint.SeverityError { |
| 204 | t.Errorf("expected error severity, got %q for %s", iss.Severity(), iss.RuleName()) |
| 205 | } |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | func TestLint_CustomWarningSeverity(t *testing.T) { |
| 210 | conf := config.NewDefault() |
nothing calls this directly
no test coverage detected