(t *testing.T)
| 54 | } |
| 55 | |
| 56 | func TestLint_ValidCommits(t *testing.T) { |
| 57 | linter := newDefaultLinter(t) |
| 58 | for _, tc := range validCommitCases { |
| 59 | t.Run(tc.name, func(t *testing.T) { |
| 60 | result, err := linter.ParseAndLint(tc.msg) |
| 61 | if err != nil { |
| 62 | t.Fatalf("unexpected error: %v", err) |
| 63 | } |
| 64 | if len(result.Issues()) != 0 { |
| 65 | t.Errorf("expected 0 issues for %q, got %d:", tc.msg, len(result.Issues())) |
| 66 | for _, iss := range result.Issues() { |
| 67 | t.Logf(" [%s] %s: %s", iss.Severity(), iss.RuleName(), iss.Description()) |
| 68 | } |
| 69 | } |
| 70 | }) |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | // --------------------------------------------------------------------------- |
| 75 | // Table-driven: invalid commits (>= wantMin issues expected) |
nothing calls this directly
no test coverage detected