aboutsummaryrefslogtreecommitdiffstats
path: root/clients/common/common_test.go
diff options
context:
space:
mode:
authorAlberto Cortés <alcortesm@gmail.com>2016-10-18 15:23:01 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-10-18 15:23:01 +0200
commit5f7d34066cc5583ee30a315e0661b5326dc548db (patch)
treec10fdbf1f42d5b51de25c6828ba6573dd28f4536 /clients/common/common_test.go
parent6c6a37b9128189ba4cdde8128428a36ef75d1a44 (diff)
downloadgo-git-5f7d34066cc5583ee30a315e0661b5326dc548db.tar.gz
Substitute old pktline encoder/decoder with new pktline scanner (#84)
* replace old pktline package with new pktline scanner * remove error checks on pktline.NewFromString * fix deppend bug * reduce memory garbage when pktline.NewFromStrings * improve int to hex conversion to help gc * make intToHex func private * clean function names
Diffstat (limited to 'clients/common/common_test.go')
-rw-r--r--clients/common/common_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/clients/common/common_test.go b/clients/common/common_test.go
index cc6c6d1..66a49e1 100644
--- a/clients/common/common_test.go
+++ b/clients/common/common_test.go
@@ -5,9 +5,10 @@ import (
"encoding/base64"
"testing"
- . "gopkg.in/check.v1"
"gopkg.in/src-d/go-git.v4/core"
- "gopkg.in/src-d/go-git.v4/formats/pktline"
+ "gopkg.in/src-d/go-git.v4/formats/packp/pktline"
+
+ . "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }
@@ -48,7 +49,7 @@ func (s *SuiteCommon) TestGitUploadPackInfo(c *C) {
b, _ := base64.StdEncoding.DecodeString(GitUploadPackInfoFixture)
i := NewGitUploadPackInfo()
- err := i.Decode(pktline.NewDecoder(bytes.NewBuffer(b)))
+ err := i.Decode(pktline.NewScanner(bytes.NewBuffer(b)))
c.Assert(err, IsNil)
name := i.Capabilities.SymbolicReference("HEAD")
@@ -70,7 +71,7 @@ func (s *SuiteCommon) TestGitUploadPackInfoNoHEAD(c *C) {
b, _ := base64.StdEncoding.DecodeString(GitUploadPackInfoNoHEADFixture)
i := NewGitUploadPackInfo()
- err := i.Decode(pktline.NewDecoder(bytes.NewBuffer(b)))
+ err := i.Decode(pktline.NewScanner(bytes.NewBuffer(b)))
c.Assert(err, IsNil)
name := i.Capabilities.SymbolicReference("HEAD")
@@ -86,7 +87,7 @@ func (s *SuiteCommon) TestGitUploadPackInfoEmpty(c *C) {
b := bytes.NewBuffer(nil)
i := NewGitUploadPackInfo()
- err := i.Decode(pktline.NewDecoder(b))
+ err := i.Decode(pktline.NewScanner(b))
c.Assert(err, ErrorMatches, "permanent.*empty.*")
}