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

Method TestRead

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

Source from the content-addressed store, hash-verified

18var _ = Suite(&BinarySuite{})
19
20func (s *BinarySuite) TestRead(c *C) {
21 buf := bytes.NewBuffer(nil)
22 err := binary.Write(buf, binary.BigEndian, int64(42))
23 c.Assert(err, IsNil)
24 err = binary.Write(buf, binary.BigEndian, int32(42))
25 c.Assert(err, IsNil)
26
27 var i64 int64
28 var i32 int32
29 err = Read(buf, &i64, &i32)
30 c.Assert(err, IsNil)
31 c.Assert(i64, Equals, int64(42))
32 c.Assert(i32, Equals, int32(42))
33}
34
35func (s *BinarySuite) TestReadUntil(c *C) {
36 buf := bytes.NewBuffer([]byte("foo bar"))

Callers

nothing calls this directly

Calls 2

ReadFunction · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected