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

Method TestReadHash

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

Source from the content-addressed store, hash-verified

113}
114
115func (s *BinarySuite) TestReadHash(c *C) {
116 expected := plumbing.NewHash("43aec75c611f22c73b27ece2841e6ccca592f285")
117 buf := bytes.NewBuffer(nil)
118 err := binary.Write(buf, binary.BigEndian, expected)
119 c.Assert(err, IsNil)
120
121 hash, err := ReadHash(buf)
122 c.Assert(err, IsNil)
123 c.Assert(hash.String(), Equals, expected.String())
124}
125
126func (s *BinarySuite) TestIsBinary(c *C) {
127 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