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

Method TestReadUint16

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

Source from the content-addressed store, hash-verified

103}
104
105func (s *BinarySuite) TestReadUint16(c *C) {
106 buf := bytes.NewBuffer(nil)
107 err := binary.Write(buf, binary.BigEndian, uint16(42))
108 c.Assert(err, IsNil)
109
110 i32, err := ReadUint16(buf)
111 c.Assert(err, IsNil)
112 c.Assert(i32, Equals, uint16(42))
113}
114
115func (s *BinarySuite) TestReadHash(c *C) {
116 expected := plumbing.NewHash("43aec75c611f22c73b27ece2841e6ccca592f285")

Callers

nothing calls this directly

Calls 2

ReadUint16Function · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected