Skip to content

Commit 7a3072e

Browse files
Fix test to look at all test commits
Authored-by: Owen Nelson <[email protected]>
1 parent 5a4b8c9 commit 7a3072e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

gitrepo/gitrepo_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ func TestNewRepoGetsCreatedWithAbsolutePath(t *testing.T) {
3131

3232
func TestNoAdditionsBetweenSameRef(t *testing.T) {
3333
doInRepoWithCommit(func(git *git_testing.GitTesting) {
34-
assert.Len(t, RepoLocatedAt(git.GetRoot()).AdditionsWithinRange("HEAD", "HEAD"), 0, "There should be no additions between a ref and itself.")
34+
assert.Len(t, RepoLocatedAt(git.GetRoot()).AdditionsWithinRange("HEAD", "HEAD"), 0,
35+
"There should be no additions between a ref and itself.")
3536
})
3637
}
3738

@@ -139,7 +140,7 @@ func TestOutgoingContentOfModifiedFilesIsAvailableInChanges(t *testing.T) {
139140
git.AddAndcommit("a.txt", "added to lorem-ipsum content with my own stuff!")
140141
repo := RepoLocatedAt(git.GetRoot())
141142
assert.Len(t, repo.additionsInLastCommit(), 1)
142-
assert.True(t, strings.HasSuffix(string(repo.AdditionsWithinRange("HEAD~1", "HEAD")[0].Data), "New content.\nSpanning multiple lines, even."))
143+
assert.True(t, strings.HasSuffix(string(repo.additionsInLastCommit()[0].Data), "New content.\nSpanning multiple lines, even."))
143144
})
144145
}
145146

@@ -153,15 +154,16 @@ func TestMultipleOutgoingChangesToTheSameFileAreAvailableInAdditions(t *testing.
153154

154155
repo := RepoLocatedAt(git.GetRoot())
155156
assert.Len(t, repo.additionsInLastCommit(), 1)
156-
assert.True(t, strings.HasSuffix(string(repo.AdditionsWithinRange("HEAD~1", "HEAD")[0].Data), "New content.\nMore new content.\n"))
157+
assert.True(t, strings.HasSuffix(string(repo.AdditionsWithinRange("HEAD~2", "HEAD")[0].Data), "New content.\nMore new content.\n"))
157158
})
158159
}
159160

160161
func TestContentOfDeletedFilesIsNotAvailableInChanges(t *testing.T) {
161162
doInRepoWithCommit(func(git *git_testing.GitTesting) {
162163
git.RemoveFile("a.txt")
163164
git.AddAndcommit("a.txt", "Deleted this file. After all, it only had lorem-ipsum content.")
164-
assert.Equal(t, 0, len(RepoLocatedAt(git.GetRoot()).additionsInLastCommit()), "There should be no additions because there only an outgoing deletion")
165+
assert.Equal(t, 0, len(RepoLocatedAt(git.GetRoot()).additionsInLastCommit()),
166+
"There should be no additions because there is only an outgoing deletion")
165167
})
166168
}
167169

0 commit comments

Comments
 (0)