MCPcopy
hub / github.com/go-git/go-git / TestObjectLookupIter

Method TestObjectLookupIter

plumbing/storer/object_test.go:65–79  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

63}
64
65func (s *ObjectSuite) TestObjectLookupIter(c *C) {
66 var count int
67
68 storage := &MockObjectStorage{s.Objects}
69 i := NewEncodedObjectLookupIter(storage, plumbing.CommitObject, s.Hash)
70 err := i.ForEach(func(o plumbing.EncodedObject) error {
71 c.Assert(o, NotNil)
72 c.Assert(o.Hash().String(), Equals, s.Hash[count].String())
73 count++
74 return nil
75 })
76
77 c.Assert(err, IsNil)
78 i.Close()
79}
80
81func (s *ObjectSuite) TestObjectSliceIter(c *C) {
82 var count int

Callers

nothing calls this directly

Calls 5

ForEachMethod · 0.95
CloseMethod · 0.95
StringMethod · 0.65
HashMethod · 0.65

Tested by

no test coverage detected