Skip to content

Commit 027dadf

Browse files
committed
add back test for NewCommitFileIterFromIter
Signed-off-by: Saeed Rasooli <[email protected]>
1 parent e0378b2 commit 027dadf

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

repository_test.go

+11
Original file line numberDiff line numberDiff line change
@@ -1667,6 +1667,17 @@ func (m *mockErrCommitIter) ForEach(func(*object.Commit) error) error {
16671667
func (m *mockErrCommitIter) Close() {}
16681668

16691669
func (s *RepositorySuite) TestLogFileWithError(c *C) {
1670+
fileName := "README"
1671+
cIter := object.NewCommitFileIterFromIter(fileName, &mockErrCommitIter{}, false)
1672+
defer cIter.Close()
1673+
1674+
err := cIter.ForEach(func(commit *object.Commit) error {
1675+
return nil
1676+
})
1677+
c.Assert(err, NotNil)
1678+
}
1679+
1680+
func (s *RepositorySuite) TestLogPathWithError(c *C) {
16701681
fileName := "README"
16711682
pathIter := func(path string) bool {
16721683
return path == fileName

0 commit comments

Comments
 (0)