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

Method TestReadUint16

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

Source from the content-addressed store, hash-verified

77}
78
79func (s *BinarySuite) TestReadUint16(c *C) {
80 buf := bytes.NewBuffer(nil)
81 err := binary.Write(buf, binary.BigEndian, uint16(42))
82 c.Assert(err, IsNil)
83
84 i32, err := ReadUint16(buf)
85 c.Assert(err, IsNil)
86 c.Assert(i32, Equals, uint16(42))
87}
88
89func (s *BinarySuite) TestReadHash(c *C) {
90 expected := plumbing.NewHash("43aec75c611f22c73b27ece2841e6ccca592f285")

Callers

nothing calls this directly

Calls 2

ReadUint16Function · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected