aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorknqyf263 <knqyf263@gmail.com>2019-08-03 15:50:31 -1000
committerknqyf263 <knqyf263@gmail.com>2019-08-03 16:40:35 -1000
commit0373247790c1dd490f6756697c9d89bed9f7c4bb (patch)
tree2895793e40aae8937e12f7c865ba3a8d812373f3 /repository_test.go
parent0d1a009cbb604db18be960db5f1525b99a55d727 (diff)
downloadgo-git-0373247790c1dd490f6756697c9d89bed9f7c4bb.tar.gz
Add assertion for unhandled error in TestLogFile
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/repository_test.go b/repository_test.go
index b87eabb..d7450c4 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -13,6 +13,8 @@ import (
"testing"
"time"
+ fixtures "gopkg.in/src-d/go-git-fixtures.v3"
+
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
openpgperr "golang.org/x/crypto/openpgp/errors"
@@ -31,7 +33,6 @@ import (
"gopkg.in/src-d/go-billy.v4/memfs"
"gopkg.in/src-d/go-billy.v4/osfs"
"gopkg.in/src-d/go-billy.v4/util"
- "gopkg.in/src-d/go-git-fixtures.v3"
)
type RepositorySuite struct {
@@ -1507,12 +1508,13 @@ func (s *RepositorySuite) TestLogFileForEach(c *C) {
}
expectedIndex := 0
- cIter.ForEach(func(commit *object.Commit) error {
+ err = cIter.ForEach(func(commit *object.Commit) error {
expectedCommitHash := commitOrder[expectedIndex]
c.Assert(commit.Hash.String(), Equals, expectedCommitHash.String())
expectedIndex++
return nil
})
+ c.Assert(err, IsNil)
c.Assert(expectedIndex, Equals, 1)
}
@@ -1551,12 +1553,13 @@ func (s *RepositorySuite) TestLogAllFileForEach(c *C) {
}
expectedIndex := 0
- cIter.ForEach(func(commit *object.Commit) error {
+ err = cIter.ForEach(func(commit *object.Commit) error {
expectedCommitHash := commitOrder[expectedIndex]
c.Assert(commit.Hash.String(), Equals, expectedCommitHash.String())
expectedIndex++
return nil
})
+ c.Assert(err, IsNil)
c.Assert(expectedIndex, Equals, 1)
}
@@ -1598,12 +1601,13 @@ func (s *RepositorySuite) TestLogFileInitialCommit(c *C) {
}
expectedIndex := 0
- cIter.ForEach(func(commit *object.Commit) error {
+ err = cIter.ForEach(func(commit *object.Commit) error {
expectedCommitHash := commitOrder[expectedIndex]
c.Assert(commit.Hash.String(), Equals, expectedCommitHash.String())
expectedIndex++
return nil
})
+ c.Assert(err, IsNil)
c.Assert(expectedIndex, Equals, 1)
}