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

Method TestReader

plumbing/memory_test.go:47–57  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

45}
46
47func (s *MemoryObjectSuite) TestReader(c *C) {
48 o := &MemoryObject{cont: []byte("foo")}
49
50 reader, err := o.Reader()
51 c.Assert(err, IsNil)
52 defer func() { c.Assert(reader.Close(), IsNil) }()
53
54 b, err := io.ReadAll(reader)
55 c.Assert(err, IsNil)
56 c.Assert(b, DeepEquals, []byte("foo"))
57}
58
59func (s *MemoryObjectSuite) TestSeekableReader(c *C) {
60 const pageSize = 4096

Callers

nothing calls this directly

Calls 2

ReaderMethod · 0.95
CloseMethod · 0.65

Tested by

no test coverage detected