aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/hash_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-12-05 15:44:50 +0100
committerGitHub <noreply@github.com>2016-12-05 15:44:50 +0100
commit11735c3b3aaa8f789dc10739a4de7ad438196000 (patch)
treec83fa6ddf9748fd0e4e4edb4d0e2692994145ace /plumbing/hash_test.go
parent0042bb031676a20ffc789f94e332a6da70e2756d (diff)
downloadgo-git-11735c3b3aaa8f789dc10739a4de7ad438196000.tar.gz
plumbing/protocol: paktp avoid duplication of haves, wants and shallow (#158)
Diffstat (limited to 'plumbing/hash_test.go')
-rw-r--r--plumbing/hash_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/plumbing/hash_test.go b/plumbing/hash_test.go
index 370811e..fc2428b 100644
--- a/plumbing/hash_test.go
+++ b/plumbing/hash_test.go
@@ -40,3 +40,15 @@ func (s *HashSuite) TestNewHasher(c *C) {
hasher.Write([]byte(content))
c.Assert(hasher.Sum().String(), Equals, "dc42c3cc80028d0ec61f0a6b24cadd1c195c4dfc")
}
+
+func (s *HashSuite) TestHashesSort(c *C) {
+ i := []Hash{
+ NewHash("2222222222222222222222222222222222222222"),
+ NewHash("1111111111111111111111111111111111111111"),
+ }
+
+ HashesSort(i)
+
+ c.Assert(i[0], Equals, NewHash("1111111111111111111111111111111111111111"))
+ c.Assert(i[1], Equals, NewHash("2222222222222222222222222222222222222222"))
+}