aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/advrefs_encode_test.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-12-05 11:59:00 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-12-05 11:59:00 +0100
commit19f59e782b92d32cc430619c77053c764a3180f9 (patch)
tree4fc53ecba70661b2ecafea90d5f72440ad4b8b2b /plumbing/protocol/packp/advrefs_encode_test.go
parent6996381ae43936e7365395e90c8f93372e49be9f (diff)
downloadgo-git-19f59e782b92d32cc430619c77053c764a3180f9.tar.gz
protocol/packp: improve AdvRefs tests (#157)
* protocol/packp: fix Example* func names for AdvRefs. * protocol/packp: test AdvRefs Encode/Decode, no internal functions.
Diffstat (limited to 'plumbing/protocol/packp/advrefs_encode_test.go')
-rw-r--r--plumbing/protocol/packp/advrefs_encode_test.go7
1 files changed, 2 insertions, 5 deletions
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.*")
}