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

Method TestReadHash

utils/binary/read_test.go:89–98  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

87}
88
89func (s *BinarySuite) TestReadHash(c *C) {
90 expected := plumbing.NewHash("43aec75c611f22c73b27ece2841e6ccca592f285")
91 buf := bytes.NewBuffer(nil)
92 err := binary.Write(buf, binary.BigEndian, expected)
93 c.Assert(err, IsNil)
94
95 hash, err := ReadHash(buf)
96 c.Assert(err, IsNil)
97 c.Assert(hash.String(), Equals, expected.String())
98}
99
100func (s *BinarySuite) TestIsBinary(c *C) {
101 buf := bytes.NewBuffer(nil)

Callers

nothing calls this directly

Calls 5

StringMethod · 0.95
NewHashFunction · 0.92
ReadHashFunction · 0.85
StringMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected