(t *testing.T)
| 57 | } |
| 58 | |
| 59 | func TestParseUnifiedDiff_NoCountHunk(t *testing.T) { |
| 60 | // `@@ -5 +7 @@` (count omitted on both sides → 1 line each) |
| 61 | raw := strings.Join([]string{ |
| 62 | "diff --git a/f b/f", |
| 63 | "--- a/f", |
| 64 | "+++ b/f", |
| 65 | "@@ -5 +7 @@", |
| 66 | "-old line", |
| 67 | "+new line", |
| 68 | "", |
| 69 | }, "\n") |
| 70 | got := parseUnifiedDiff(raw) |
| 71 | fd := got["f"] |
| 72 | assert.Equal(t, []int{5}, fd.Deletions) |
| 73 | assert.Equal(t, []int{7}, fd.Additions) |
| 74 | } |
| 75 | |
| 76 | func TestParseUnifiedDiff_NewFile(t *testing.T) { |
| 77 | raw := strings.Join([]string{ |
nothing calls this directly
no test coverage detected