diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-14 12:30:19 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-14 12:30:19 +0200 |
commit | 91bf16b2336e6f80f0742be729582fe5fbbada83 (patch) | |
tree | 935a95f72e824543970c8254c39cf0afa22b3410 /formats/packfile/parser_test.go | |
parent | f826cf9d42cc34e2ae5aaf6ede892ecab9d2f198 (diff) | |
download | go-git-91bf16b2336e6f80f0742be729582fe5fbbada83.tar.gz |
core: removing Object.Content, the Reader should be used always
Diffstat (limited to 'formats/packfile/parser_test.go')
-rw-r--r-- | formats/packfile/parser_test.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/formats/packfile/parser_test.go b/formats/packfile/parser_test.go index 5d41d69..f4aff83 100644 --- a/formats/packfile/parser_test.go +++ b/formats/packfile/parser_test.go @@ -240,7 +240,10 @@ func (s *ParserSuite) TestReadNonDeltaObjectContent(c *C) { obj := &core.MemoryObject{} err = p.FillFromNonDeltaContent(obj) c.Assert(err, IsNil, com) - c.Assert(obj.Content(), DeepEquals, test.expected, com) + + r, _ := obj.Reader() + bytes, _ := ioutil.ReadAll(r) + c.Assert(bytes, DeepEquals, test.expected, com) } } @@ -297,7 +300,10 @@ func (s *ParserSuite) TestFillOFSDeltaObjectContent(c *C) { err = p.FillOFSDeltaObjectContent(obj, test.offset) c.Assert(err, IsNil, com) c.Assert(obj.Type(), Equals, test.expType, com) - c.Assert(obj.Content(), DeepEquals, test.expContent, com) + + r, _ := obj.Reader() + bytes, _ := ioutil.ReadAll(r) + c.Assert(bytes, DeepEquals, test.expContent, com) } } @@ -361,7 +367,10 @@ func (s *ParserSuite) TestFillREFDeltaObjectContent(c *C) { err = p.FillREFDeltaObjectContent(obj) c.Assert(err, IsNil, com) c.Assert(obj.Type(), Equals, test.expType, com) - c.Assert(obj.Content(), DeepEquals, test.expContent, com) + + r, _ := obj.Reader() + bytes, _ := ioutil.ReadAll(r) + c.Assert(bytes, DeepEquals, test.expContent, com) p.ForgetAll() } |