@@ -31,7 +31,8 @@ func TestNewRepoGetsCreatedWithAbsolutePath(t *testing.T) {
31
31
32
32
func TestNoAdditionsBetweenSameRef (t * testing.T ) {
33
33
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." )
35
36
})
36
37
}
37
38
@@ -139,7 +140,7 @@ func TestOutgoingContentOfModifiedFilesIsAvailableInChanges(t *testing.T) {
139
140
git .AddAndcommit ("a.txt" , "added to lorem-ipsum content with my own stuff!" )
140
141
repo := RepoLocatedAt (git .GetRoot ())
141
142
assert .Len (t , repo .additionsInLastCommit (), 1 )
142
- assert .True (t , strings .HasSuffix (string (repo .AdditionsWithinRange ( "HEAD~1" , "HEAD" )[0 ].Data ), "New content.\n Spanning multiple lines, even." ))
143
+ assert .True (t , strings .HasSuffix (string (repo .additionsInLastCommit ( )[0 ].Data ), "New content.\n Spanning multiple lines, even." ))
143
144
})
144
145
}
145
146
@@ -153,15 +154,16 @@ func TestMultipleOutgoingChangesToTheSameFileAreAvailableInAdditions(t *testing.
153
154
154
155
repo := RepoLocatedAt (git .GetRoot ())
155
156
assert .Len (t , repo .additionsInLastCommit (), 1 )
156
- assert .True (t , strings .HasSuffix (string (repo .AdditionsWithinRange ("HEAD~1 " , "HEAD" )[0 ].Data ), "New content.\n More new content.\n " ))
157
+ assert .True (t , strings .HasSuffix (string (repo .AdditionsWithinRange ("HEAD~2 " , "HEAD" )[0 ].Data ), "New content.\n More new content.\n " ))
157
158
})
158
159
}
159
160
160
161
func TestContentOfDeletedFilesIsNotAvailableInChanges (t * testing.T ) {
161
162
doInRepoWithCommit (func (git * git_testing.GitTesting ) {
162
163
git .RemoveFile ("a.txt" )
163
164
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" )
165
167
})
166
168
}
167
169
0 commit comments