From 027dadf289dcf974405d283d13d5a856b0988b38 Mon Sep 17 00:00:00 2001 From: Saeed Rasooli Date: Fri, 29 Nov 2019 16:44:43 +0330 Subject: add back test for NewCommitFileIterFromIter Signed-off-by: Saeed Rasooli --- repository_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'repository_test.go') diff --git a/repository_test.go b/repository_test.go index 65c1423..06b748a 100644 --- a/repository_test.go +++ b/repository_test.go @@ -1667,6 +1667,17 @@ func (m *mockErrCommitIter) ForEach(func(*object.Commit) error) error { func (m *mockErrCommitIter) Close() {} func (s *RepositorySuite) TestLogFileWithError(c *C) { + fileName := "README" + cIter := object.NewCommitFileIterFromIter(fileName, &mockErrCommitIter{}, false) + defer cIter.Close() + + err := cIter.ForEach(func(commit *object.Commit) error { + return nil + }) + c.Assert(err, NotNil) +} + +func (s *RepositorySuite) TestLogPathWithError(c *C) { fileName := "README" pathIter := func(path string) bool { return path == fileName -- cgit