aboutsummaryrefslogtreecommitdiffstats
path: root/formats/packfile/parser_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-12 12:49:46 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-12 12:49:46 +0200
commite1f7b169aaa99d07fe8ad8e71a0cba2322e7d35f (patch)
tree50f195024fa492120db0c9822111cc84b0c659ce /formats/packfile/parser_test.go
parent8948d4b48acfc39462f0c75525bc6b53c1ac59b2 (diff)
downloadgo-git-e1f7b169aaa99d07fe8ad8e71a0cba2322e7d35f.tar.gz
small improvements
Diffstat (limited to 'formats/packfile/parser_test.go')
-rw-r--r--formats/packfile/parser_test.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/formats/packfile/parser_test.go b/formats/packfile/parser_test.go
index c2b99f1..5d41d69 100644
--- a/formats/packfile/parser_test.go
+++ b/formats/packfile/parser_test.go
@@ -238,13 +238,13 @@ func (s *ParserSuite) TestReadNonDeltaObjectContent(c *C) {
c.Assert(err, IsNil, com)
obj := &core.MemoryObject{}
- err = p.ReadNonDeltaObjectContent(obj)
+ err = p.FillFromNonDeltaContent(obj)
c.Assert(err, IsNil, com)
c.Assert(obj.Content(), DeepEquals, test.expected, com)
}
}
-func (s *ParserSuite) TestReadOFSDeltaObjectContent(c *C) {
+func (s *ParserSuite) TestFillOFSDeltaObjectContent(c *C) {
for i, test := range [...]struct {
fixID string
offset int64
@@ -294,14 +294,14 @@ func (s *ParserSuite) TestReadOFSDeltaObjectContent(c *C) {
c.Assert(err, IsNil, com)
obj := &core.MemoryObject{}
- err = p.ReadOFSDeltaObjectContent(obj, test.offset)
+ 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)
}
}
-func (s *ParserSuite) TestReadREFDeltaObjectContent(c *C) {
+func (s *ParserSuite) TestFillREFDeltaObjectContent(c *C) {
for i, test := range [...]struct {
fixID string
offset int64
@@ -358,7 +358,7 @@ func (s *ParserSuite) TestReadREFDeltaObjectContent(c *C) {
c.Assert(err, IsNil, com)
obj := &core.MemoryObject{}
- err = p.ReadREFDeltaObjectContent(obj)
+ 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)
@@ -368,7 +368,12 @@ func (s *ParserSuite) TestReadREFDeltaObjectContent(c *C) {
}
func newObject(t core.ObjectType, c []byte) core.Object {
- return core.NewMemoryObject(t, int64(len(c)), c)
+ o := &core.MemoryObject{}
+ o.SetType(t)
+ o.SetSize(int64(len(c)))
+ o.Write(c)
+
+ return o
}
func (s *ParserSuite) TestReadHeaderBadSignatureError(c *C) {