--------------------------------------------------------------------------- Result preservation ---------------------------------------------------------------------------
(t *testing.T)
| 169 | // --------------------------------------------------------------------------- |
| 170 | |
| 171 | func TestLint_ResultPreservesInput(t *testing.T) { |
| 172 | linter := newDefaultLinter(t) |
| 173 | msgs := []string{ |
| 174 | "feat: add something new", |
| 175 | "invalid message", |
| 176 | "fix: x", |
| 177 | } |
| 178 | for _, msg := range msgs { |
| 179 | result, err := linter.ParseAndLint(msg) |
| 180 | if err != nil { |
| 181 | t.Fatalf("unexpected error: %v", err) |
| 182 | } |
| 183 | if result.Input() != msg { |
| 184 | t.Errorf("expected input %q, got %q", msg, result.Input()) |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | // --------------------------------------------------------------------------- |
| 190 | // Severity tests |
nothing calls this directly
no test coverage detected