From 19f59e782b92d32cc430619c77053c764a3180f9 Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Mon, 5 Dec 2016 11:59:00 +0100 Subject: protocol/packp: improve AdvRefs tests (#157) * protocol/packp: fix Example* func names for AdvRefs. * protocol/packp: test AdvRefs Encode/Decode, no internal functions. --- plumbing/protocol/packp/advrefs_encode_test.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'plumbing/protocol/packp/advrefs_encode_test.go') diff --git a/plumbing/protocol/packp/advrefs_encode_test.go b/plumbing/protocol/packp/advrefs_encode_test.go index f8cc815..f901440 100644 --- a/plumbing/protocol/packp/advrefs_encode_test.go +++ b/plumbing/protocol/packp/advrefs_encode_test.go @@ -17,9 +17,7 @@ var _ = Suite(&AdvRefsEncodeSuite{}) func testEncode(c *C, input *AdvRefs, expected []byte) { var buf bytes.Buffer - e := newAdvRefsEncoder(&buf) - err := e.Encode(input) - c.Assert(err, IsNil) + c.Assert(input.Encode(&buf), IsNil) obtained := buf.Bytes() comment := Commentf("\nobtained = %s\nexpected = %s\n", string(obtained), string(expected)) @@ -232,7 +230,6 @@ func (s *AdvRefsEncodeSuite) TestErrorTooLong(c *C) { } var buf bytes.Buffer - e := newAdvRefsEncoder(&buf) - err := e.Encode(ar) + err := ar.Encode(&buf) c.Assert(err, ErrorMatches, ".*payload is too long.*") } -- cgit