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

Method TestReadObjfile

plumbing/format/objfile/reader_test.go:18–27  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

16var _ = Suite(&SuiteReader{})
17
18func (s *SuiteReader) TestReadObjfile(c *C) {
19 for k, fixture := range objfileFixtures {
20 com := fmt.Sprintf("test %d: ", k)
21 hash := plumbing.NewHash(fixture.hash)
22 content, _ := base64.StdEncoding.DecodeString(fixture.content)
23 data, _ := base64.StdEncoding.DecodeString(fixture.data)
24
25 testReader(c, bytes.NewReader(data), hash, fixture.t, content, com)
26 }
27}
28
29func testReader(c *C, source io.Reader, hash plumbing.Hash, t plumbing.ObjectType, content []byte, com string) {
30 r, err := NewReader(source)

Callers

nothing calls this directly

Calls 2

NewHashFunction · 0.92
testReaderFunction · 0.85

Tested by

no test coverage detected