(t *testing.T)
| 74 | } |
| 75 | |
| 76 | func TestParseUnifiedDiff_NewFile(t *testing.T) { |
| 77 | raw := strings.Join([]string{ |
| 78 | "diff --git a/src/new.rs b/src/new.rs", |
| 79 | "new file mode 100644", |
| 80 | "index 0000000..abcdef", |
| 81 | "--- /dev/null", |
| 82 | "+++ b/src/new.rs", |
| 83 | "@@ -0,0 +1,3 @@", |
| 84 | "+pub fn a() {}", |
| 85 | "+", |
| 86 | "+pub fn b() {}", |
| 87 | "", |
| 88 | }, "\n") |
| 89 | |
| 90 | got := parseUnifiedDiff(raw) |
| 91 | fd, ok := got["src/new.rs"] |
| 92 | require.True(t, ok) |
| 93 | assert.True(t, fd.IsNew) |
| 94 | assert.Equal(t, []int{1, 2, 3}, fd.Additions) |
| 95 | } |
| 96 | |
| 97 | func TestGetCommitFileDiffs(t *testing.T) { |
| 98 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected