MCPcopy Create free account
hub / github.com/go-git/go-git / TestIter

Method TestIter

storage/filesystem/object_test.go:198–215  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

196}
197
198func (s *FsSuite) TestIter(c *C) {
199 fixtures.ByTag(".git").ByTag("packfile").Test(c, func(f *fixtures.Fixture) {
200 fs := f.DotGit()
201 o := NewObjectStorage(dotgit.New(fs), cache.NewObjectLRUDefault())
202
203 iter, err := o.IterEncodedObjects(plumbing.AnyObject)
204 c.Assert(err, IsNil)
205
206 var count int32
207 err = iter.ForEach(func(o plumbing.EncodedObject) error {
208 count++
209 return nil
210 })
211
212 c.Assert(err, IsNil)
213 c.Assert(count, Equals, f.ObjectsCount)
214 })
215}
216
217func (s *FsSuite) TestIterLargeObjectThreshold(c *C) {
218 fixtures.ByTag(".git").ByTag("packfile").Test(c, func(f *fixtures.Fixture) {

Callers

nothing calls this directly

Calls 5

IterEncodedObjectsMethod · 0.95
NewFunction · 0.92
NewObjectLRUDefaultFunction · 0.92
NewObjectStorageFunction · 0.70
ForEachMethod · 0.65

Tested by

no test coverage detected