@@ -31,7 +31,8 @@ func TestNewRepoGetsCreatedWithAbsolutePath(t *testing.T) {
3131
3232func 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.\n Spanning multiple lines, even." ))
143+ assert .True (t , strings .HasSuffix (string (repo .additionsInLastCommit ( )[0 ].Data ), "New content.\n Spanning 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.\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 " ))
157158 })
158159}
159160
160161func 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