(t *testing.T)
| 165 | } |
| 166 | |
| 167 | func TestGetCommitRangeFileStats_NewFile(t *testing.T) { |
| 168 | tmpDir := t.TempDir() |
| 169 | setupGitRepo(t, tmpDir) |
| 170 | |
| 171 | // Create first commit |
| 172 | createFile(t, tmpDir, "first.txt", "content") |
| 173 | gitAdd(t, tmpDir, "first.txt") |
| 174 | firstCommit := gitCommitAndGetSHA(t, tmpDir, "First commit") |
| 175 | |
| 176 | // Add new file |
| 177 | createFile(t, tmpDir, "new.txt", "line1\nline2\n") |
| 178 | gitAdd(t, tmpDir, "new.txt") |
| 179 | secondCommit := gitCommitAndGetSHA(t, tmpDir, "Second commit") |
| 180 | |
| 181 | stats, err := GetCommitRangeFileStats(tmpDir, firstCommit, secondCommit) |
| 182 | |
| 183 | require.NoError(t, err) |
| 184 | g := testhelpers.TextGoldie(t) |
| 185 | g.Assert(t, t.Name(), []byte(normalizeFileStats(tmpDir, stats))) |
| 186 | } |
| 187 | |
| 188 | func TestGetCommitRangeFileStats_MultipleFiles(t *testing.T) { |
| 189 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected