diff options
Diffstat (limited to 'repository_test.go')
-rw-r--r-- | repository_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/repository_test.go b/repository_test.go index f9e3ca4..2bca078 100644 --- a/repository_test.go +++ b/repository_test.go @@ -10,6 +10,7 @@ import ( "os" "os/exec" "path/filepath" + "regexp" "strings" "testing" "time" @@ -1679,6 +1680,20 @@ func (s *RepositorySuite) TestLogFileWithError(c *C) { c.Assert(err, NotNil) } +func (s *RepositorySuite) TestLogPathRegexpWithError(c *C) { + pathRE := regexp.MustCompile("R.*E") + pathIter := func(path string) bool { + return pathRE.MatchString(path) + } + cIter := object.NewCommitPathIterFromIter(pathIter, &mockErrCommitIter{}, false) + defer cIter.Close() + + err := cIter.ForEach(func(commit *object.Commit) error { + return nil + }) + c.Assert(err, NotNil) +} + func (s *RepositorySuite) TestLogLimitNext(c *C) { r, _ := Init(memory.NewStorage(), nil) err := r.clone(context.Background(), &CloneOptions{ |