MCPcopy Index your code
hub / github.com/go-git/go-git / TestIter

Method TestIter

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

Source from the content-addressed store, hash-verified

230}
231
232func (s *FsSuite) TestIter(c *C) {
233 fixtures.ByTag(".git").ByTag("packfile").Test(c, func(f *fixtures.Fixture) {
234 fs := f.DotGit()
235 o := NewObjectStorage(dotgit.New(fs), cache.NewObjectLRUDefault())
236
237 iter, err := o.IterEncodedObjects(plumbing.AnyObject)
238 c.Assert(err, IsNil)
239
240 var count int32
241 err = iter.ForEach(func(o plumbing.EncodedObject) error {
242 count++
243 return nil
244 })
245
246 c.Assert(err, IsNil)
247 c.Assert(count, Equals, f.ObjectsCount)
248 })
249}
250
251func (s *FsSuite) TestIterLargeObjectThreshold(c *C) {
252 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