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

Method testEncode

plumbing/protocol/packp/updreq_encode_test.go:18–27  ·  view source on GitHub ↗
(c *C, input *ReferenceUpdateRequest,
	expected []byte)

Source from the content-addressed store, hash-verified

16var _ = Suite(&UpdReqEncodeSuite{})
17
18func (s *UpdReqEncodeSuite) testEncode(c *C, input *ReferenceUpdateRequest,
19 expected []byte) {
20
21 var buf bytes.Buffer
22 c.Assert(input.Encode(&buf), IsNil)
23 obtained := buf.Bytes()
24
25 comment := Commentf("\nobtained = %s\nexpected = %s\n", string(obtained), string(expected))
26 c.Assert(obtained, DeepEquals, expected, comment)
27}
28
29func (s *UpdReqEncodeSuite) TestZeroValue(c *C) {
30 r := &ReferenceUpdateRequest{}

Calls 2

EncodeMethod · 0.65
BytesMethod · 0.45

Tested by

no test coverage detected