(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestConfig_NewDefault(t *testing.T) { |
| 14 | conf := config.NewDefault() |
| 15 | |
| 16 | if conf.MinVersion == "" { |
| 17 | t.Error("expected non-empty MinVersion") |
| 18 | } |
| 19 | if conf.Formatter == "" { |
| 20 | t.Error("expected non-empty Formatter") |
| 21 | } |
| 22 | if conf.Formatter != "default" { |
| 23 | t.Errorf("expected formatter 'default', got %q", conf.Formatter) |
| 24 | } |
| 25 | if len(conf.Rules) == 0 { |
| 26 | t.Error("expected non-empty rules") |
| 27 | } |
| 28 | if len(conf.Settings) == 0 { |
| 29 | t.Error("expected non-empty settings") |
| 30 | } |
| 31 | if conf.Severity.Default != lint.SeverityError { |
| 32 | t.Errorf("expected default severity 'error', got %q", conf.Severity.Default) |
| 33 | } |
| 34 | if len(conf.DefaultIgnorePatterns) == 0 { |
| 35 | t.Error("expected non-empty default ignore patterns") |
| 36 | } |
| 37 | if len(conf.IgnorePatterns) != 0 { |
| 38 | t.Error("expected empty user ignore patterns in default config") |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | func TestConfig_NewLinter(t *testing.T) { |
| 43 | conf := config.NewDefault() |
nothing calls this directly
no test coverage detected