From a48bc6e17ef6298f93ec21cdf1a5e387640673b6 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Mon, 30 Jan 2017 14:42:19 +0100 Subject: Repository.Progress moved as a field in *Options (#237) --- plumbing/protocol/packp/sideband/demux_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'plumbing/protocol/packp/sideband/demux_test.go') diff --git a/plumbing/protocol/packp/sideband/demux_test.go b/plumbing/protocol/packp/sideband/demux_test.go index ee5f19a..3d2d6ed 100644 --- a/plumbing/protocol/packp/sideband/demux_test.go +++ b/plumbing/protocol/packp/sideband/demux_test.go @@ -84,23 +84,24 @@ func (s *SidebandSuite) TestDecodeFromFailingReader(c *C) { func (s *SidebandSuite) TestDecodeWithProgress(c *C) { expected := []byte("abcdefghijklmnopqrstuvwxyz") - buf := bytes.NewBuffer(nil) - e := pktline.NewEncoder(buf) + input := bytes.NewBuffer(nil) + e := pktline.NewEncoder(input) e.Encode(PackData.WithPayload(expected[0:8])) e.Encode(ProgressMessage.WithPayload([]byte{'F', 'O', 'O', '\n'})) e.Encode(PackData.WithPayload(expected[8:16])) e.Encode(PackData.WithPayload(expected[16:26])) + output := bytes.NewBuffer(nil) content := make([]byte, 26) - d := NewDemuxer(Sideband64k, buf) - d.Progress = bytes.NewBuffer(nil) + d := NewDemuxer(Sideband64k, input) + d.Progress = output n, err := io.ReadFull(d, content) c.Assert(err, IsNil) c.Assert(n, Equals, 26) c.Assert(content, DeepEquals, expected) - progress, err := ioutil.ReadAll(d.Progress) + progress, err := ioutil.ReadAll(output) c.Assert(err, IsNil) c.Assert(progress, DeepEquals, []byte{'F', 'O', 'O', '\n'}) } -- cgit