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

Method TestWriteUint16

utils/binary/write_test.go:34–43  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

32}
33
34func (s *BinarySuite) TestWriteUint16(c *C) {
35 expected := bytes.NewBuffer(nil)
36 err := binary.Write(expected, binary.BigEndian, int16(42))
37 c.Assert(err, IsNil)
38
39 buf := bytes.NewBuffer(nil)
40 err = WriteUint16(buf, 42)
41 c.Assert(err, IsNil)
42 c.Assert(buf, DeepEquals, expected)
43}
44
45func (s *BinarySuite) TestWriteVariableWidthInt(c *C) {
46 buf := bytes.NewBuffer(nil)

Callers

nothing calls this directly

Calls 2

WriteUint16Function · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected