aboutsummaryrefslogtreecommitdiffstats
path: root/clients/common/common_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2015-11-05 23:48:38 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2015-11-05 23:48:38 +0100
commit8a305e98171cbb70e58e67c9c939eb768b886510 (patch)
tree409a9162a75f4a2e5d0edce341d3addbb8b75114 /clients/common/common_test.go
parent6be0bc1233b1a31e749354f1d54104b49d5bf19b (diff)
downloadgo-git-8a305e98171cbb70e58e67c9c939eb768b886510.tar.gz
clients: GitUploadPackInfo head change
Diffstat (limited to 'clients/common/common_test.go')
-rw-r--r--clients/common/common_test.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/clients/common/common_test.go b/clients/common/common_test.go
index 9529236..5ffb402 100644
--- a/clients/common/common_test.go
+++ b/clients/common/common_test.go
@@ -53,7 +53,7 @@ func (s *SuiteCommon) TestGitUploadPackInfo(c *C) {
ref := i.Capabilities.SymbolicReference("HEAD")
c.Assert(ref, Equals, "refs/heads/master")
c.Assert(i.Refs[ref].String(), Equals, "6ecf0ef2c2dffb796033e5a02219af86ec6584e5")
- c.Assert(i.Head, Equals, "6ecf0ef2c2dffb796033e5a02219af86ec6584e5")
+ c.Assert(i.Head.String(), Equals, "6ecf0ef2c2dffb796033e5a02219af86ec6584e5")
}
func (s *SuiteCommon) TestGitUploadPackInfoEmpty(c *C) {
@@ -73,7 +73,16 @@ func (s *SuiteCommon) TestCapabilitiesDecode(c *C) {
c.Assert(cap.Get("thin-pack").Values, DeepEquals, []string{""})
}
-func (s *SuiteCommon) TestCapabilitiesString(c *C) {
+func (s *SuiteCommon) TestCapabilitiesSet(c *C) {
+ cap := NewCapabilities()
+ cap.Add("symref", "foo", "qux")
+ cap.Set("symref", "bar")
+
+ c.Assert(cap.m, HasLen, 1)
+ c.Assert(cap.Get("symref").Values, DeepEquals, []string{"bar"})
+}
+
+func (s *SuiteCommon) TestCapabilitiesAdd(c *C) {
cap := NewCapabilities()
cap.Add("symref", "foo", "qux")
cap.Add("thin-pack")
@@ -85,9 +94,9 @@ func (s *SuiteCommon) TestGitUploadPackEncode(c *C) {
info := NewGitUploadPackInfo()
info.Capabilities.Add("symref", "HEAD:refs/heads/master")
- info.Head = "refs/heads/master"
+ info.Head = core.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")
info.Refs = map[string]core.Hash{
- "refs/heads/master": core.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5"),
+ "refs/heads/master": info.Head,
}
c.Assert(info.String(), Equals,