Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 0373247

Browse files
committed
Add assertion for unhandled error in TestLogFile
Signed-off-by: knqyf263 <knqyf263@gmail.com>
1 parent 0d1a009 commit 0373247

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

repository_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"testing"
1414
"time"
1515

16+
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
17+
1618
"golang.org/x/crypto/openpgp"
1719
"golang.org/x/crypto/openpgp/armor"
1820
openpgperr "golang.org/x/crypto/openpgp/errors"
@@ -31,7 +33,6 @@ import (
3133
"gopkg.in/src-d/go-billy.v4/memfs"
3234
"gopkg.in/src-d/go-billy.v4/osfs"
3335
"gopkg.in/src-d/go-billy.v4/util"
34-
"gopkg.in/src-d/go-git-fixtures.v3"
3536
)
3637

3738
type RepositorySuite struct {
@@ -1507,12 +1508,13 @@ func (s *RepositorySuite) TestLogFileForEach(c *C) {
15071508
}
15081509

15091510
expectedIndex := 0
1510-
cIter.ForEach(func(commit *object.Commit) error {
1511+
err = cIter.ForEach(func(commit *object.Commit) error {
15111512
expectedCommitHash := commitOrder[expectedIndex]
15121513
c.Assert(commit.Hash.String(), Equals, expectedCommitHash.String())
15131514
expectedIndex++
15141515
return nil
15151516
})
1517+
c.Assert(err, IsNil)
15161518
c.Assert(expectedIndex, Equals, 1)
15171519
}
15181520

@@ -1551,12 +1553,13 @@ func (s *RepositorySuite) TestLogAllFileForEach(c *C) {
15511553
}
15521554

15531555
expectedIndex := 0
1554-
cIter.ForEach(func(commit *object.Commit) error {
1556+
err = cIter.ForEach(func(commit *object.Commit) error {
15551557
expectedCommitHash := commitOrder[expectedIndex]
15561558
c.Assert(commit.Hash.String(), Equals, expectedCommitHash.String())
15571559
expectedIndex++
15581560
return nil
15591561
})
1562+
c.Assert(err, IsNil)
15601563
c.Assert(expectedIndex, Equals, 1)
15611564
}
15621565

@@ -1598,12 +1601,13 @@ func (s *RepositorySuite) TestLogFileInitialCommit(c *C) {
15981601
}
15991602

16001603
expectedIndex := 0
1601-
cIter.ForEach(func(commit *object.Commit) error {
1604+
err = cIter.ForEach(func(commit *object.Commit) error {
16021605
expectedCommitHash := commitOrder[expectedIndex]
16031606
c.Assert(commit.Hash.String(), Equals, expectedCommitHash.String())
16041607
expectedIndex++
16051608
return nil
16061609
})
1610+
c.Assert(err, IsNil)
16071611
c.Assert(expectedIndex, Equals, 1)
16081612
}
16091613

0 commit comments

Comments
 (0)