(t *testing.T)
| 207 | } |
| 208 | |
| 209 | func TestLint_CustomWarningSeverity(t *testing.T) { |
| 210 | conf := config.NewDefault() |
| 211 | conf.Severity.Rules = map[string]lint.Severity{ |
| 212 | "type-enum": lint.SeverityWarn, |
| 213 | } |
| 214 | rules, err := config.GetEnabledRules(conf) |
| 215 | if err != nil { |
| 216 | t.Fatal(err) |
| 217 | } |
| 218 | linter, err := lint.New(conf, rules) |
| 219 | if err != nil { |
| 220 | t.Fatal(err) |
| 221 | } |
| 222 | |
| 223 | result, err := linter.ParseAndLint("unknown: some message here") |
| 224 | if err != nil { |
| 225 | t.Fatal(err) |
| 226 | } |
| 227 | for _, iss := range result.Issues() { |
| 228 | if iss.RuleName() == "type-enum" && iss.Severity() != lint.SeverityWarn { |
| 229 | t.Errorf("expected warn for type-enum, got %q", iss.Severity()) |
| 230 | } |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | func TestLint_ParserErrorAlwaysError(t *testing.T) { |
| 235 | conf := config.NewDefault() |
nothing calls this directly
no test coverage detected