MCPcopy Create free account
hub / github.com/LegacyCodeHQ/clarity-cli / TestGetCommitRangeFileStats_NewFile

Function TestGetCommitRangeFileStats_NewFile

vcs/git/git_stats_test.go:167–186  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

165}
166
167func 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
188func TestGetCommitRangeFileStats_MultipleFiles(t *testing.T) {
189 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 8

TextGoldieFunction · 0.92
setupGitRepoFunction · 0.85
createFileFunction · 0.85
gitAddFunction · 0.85
gitCommitAndGetSHAFunction · 0.85
GetCommitRangeFileStatsFunction · 0.85
normalizeFileStatsFunction · 0.85
NameMethod · 0.65

Tested by

no test coverage detected