Skip to content

Commit

Permalink
Add assertion for unhandled error in TestLogFile
Browse files Browse the repository at this point in the history
Signed-off-by: knqyf263 <[email protected]>
  • Loading branch information
knqyf263 committed Aug 4, 2019
1 parent 0d1a009 commit 0373247
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 0373247

Please sign in to comment.