aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/ulreq_decode_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-11-29 15:11:00 +0100
committerGitHub <noreply@github.com>2016-11-29 15:11:00 +0100
commitef1a0579fbc6aac510313ce073d1dd8fc8a9202b (patch)
tree6d41484c70cef0ec6b7582e2ac15b9daccf0e54e /plumbing/protocol/packp/ulreq_decode_test.go
parent47007c70c5a696472576a522cd0e265a777f97a8 (diff)
downloadgo-git-ef1a0579fbc6aac510313ce073d1dd8fc8a9202b.tar.gz
protocol/packp: capabilities new Capability entity and List struct, test improvements (#144)
* protocol/pakp: capabilities new Capability entity and List struct, test improvements * etc: example cloud-config file * removing sorting from List.String
Diffstat (limited to 'plumbing/protocol/packp/ulreq_decode_test.go')
-rw-r--r--plumbing/protocol/packp/ulreq_decode_test.go30
1 files changed, 15 insertions, 15 deletions
diff --git a/plumbing/protocol/packp/ulreq_decode_test.go b/plumbing/protocol/packp/ulreq_decode_test.go
index eb12c90..e7d9d7c6 100644
--- a/plumbing/protocol/packp/ulreq_decode_test.go
+++ b/plumbing/protocol/packp/ulreq_decode_test.go
@@ -10,6 +10,7 @@ import (
"gopkg.in/src-d/go-git.v4/plumbing/format/pktline"
. "gopkg.in/check.v1"
+ "gopkg.in/src-d/go-git.v4/plumbing/protocol/packp/capability"
)
type UlReqDecodeSuite struct{}
@@ -87,8 +88,8 @@ func (s *UlReqDecodeSuite) TestWantWithCapabilities(c *C) {
c.Assert(ur.Wants, DeepEquals, []plumbing.Hash{
plumbing.NewHash("1111111111111111111111111111111111111111")})
- c.Assert(ur.Capabilities.Supports("ofs-delta"), Equals, true)
- c.Assert(ur.Capabilities.Supports("multi_ack"), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.OFSDelta), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.MultiACK), Equals, true)
}
func (s *UlReqDecodeSuite) TestManyWantsNoCapabilities(c *C) {
@@ -168,8 +169,8 @@ func (s *UlReqDecodeSuite) TestManyWantsWithCapabilities(c *C) {
sort.Sort(byHash(expected))
c.Assert(ur.Wants, DeepEquals, expected)
- c.Assert(ur.Capabilities.Supports("ofs-delta"), Equals, true)
- c.Assert(ur.Capabilities.Supports("multi_ack"), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.OFSDelta), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.MultiACK), Equals, true)
}
func (s *UlReqDecodeSuite) TestSingleShallowSingleWant(c *C) {
@@ -189,8 +190,8 @@ func (s *UlReqDecodeSuite) TestSingleShallowSingleWant(c *C) {
}
c.Assert(ur.Wants, DeepEquals, expectedWants)
- c.Assert(ur.Capabilities.Supports("ofs-delta"), Equals, true)
- c.Assert(ur.Capabilities.Supports("multi_ack"), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.OFSDelta), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.MultiACK), Equals, true)
c.Assert(ur.Shallows, DeepEquals, expectedShallows)
}
@@ -220,8 +221,8 @@ func (s *UlReqDecodeSuite) TestSingleShallowManyWants(c *C) {
sort.Sort(byHash(ur.Wants))
c.Assert(ur.Wants, DeepEquals, expectedWants)
- c.Assert(ur.Capabilities.Supports("ofs-delta"), Equals, true)
- c.Assert(ur.Capabilities.Supports("multi_ack"), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.OFSDelta), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.MultiACK), Equals, true)
c.Assert(ur.Shallows, DeepEquals, expectedShallows)
}
@@ -250,8 +251,8 @@ func (s *UlReqDecodeSuite) TestManyShallowSingleWant(c *C) {
sort.Sort(byHash(expectedShallows))
c.Assert(ur.Wants, DeepEquals, expectedWants)
- c.Assert(ur.Capabilities.Supports("ofs-delta"), Equals, true)
- c.Assert(ur.Capabilities.Supports("multi_ack"), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.OFSDelta), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.MultiACK), Equals, true)
sort.Sort(byHash(ur.Shallows))
c.Assert(ur.Shallows, DeepEquals, expectedShallows)
@@ -289,8 +290,8 @@ func (s *UlReqDecodeSuite) TestManyShallowManyWants(c *C) {
sort.Sort(byHash(ur.Wants))
c.Assert(ur.Wants, DeepEquals, expectedWants)
- c.Assert(ur.Capabilities.Supports("ofs-delta"), Equals, true)
- c.Assert(ur.Capabilities.Supports("multi_ack"), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.OFSDelta), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.MultiACK), Equals, true)
sort.Sort(byHash(ur.Shallows))
c.Assert(ur.Shallows, DeepEquals, expectedShallows)
@@ -500,9 +501,8 @@ func (s *UlReqDecodeSuite) TestAll(c *C) {
sort.Sort(byHash(expectedWants))
sort.Sort(byHash(ur.Wants))
c.Assert(ur.Wants, DeepEquals, expectedWants)
-
- c.Assert(ur.Capabilities.Supports("ofs-delta"), Equals, true)
- c.Assert(ur.Capabilities.Supports("multi_ack"), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.OFSDelta), Equals, true)
+ c.Assert(ur.Capabilities.Supports(capability.MultiACK), Equals, true)
expectedShallows := []plumbing.Hash{
plumbing.NewHash("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"),