diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-02-26 09:14:09 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-02-26 09:14:09 +0100 |
commit | 1e74b17f05ad27818df39818a0d22107a0b4b424 (patch) | |
tree | 3b96f28ce8196f290522dd8983a4965fdbd090f0 /core/hash_test.go | |
parent | 5bc563727ffa798caee3b007c366eb66c3d69caa (diff) | |
parent | 397526522d8b81a1485671146acb0ed58a6bfa98 (diff) | |
download | go-git-1e74b17f05ad27818df39818a0d22107a0b4b424.tar.gz |
Merge pull request #35 from scjalliance/hasher
Added Hasher for computing hashes of streamed objects
Diffstat (limited to 'core/hash_test.go')
-rw-r--r-- | core/hash_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/hash_test.go b/core/hash_test.go index 8c4ed67..782777e 100644 --- a/core/hash_test.go +++ b/core/hash_test.go @@ -33,3 +33,10 @@ func (s *HashSuite) TestIsZero(c *C) { hash = NewHash("8ab686eafeb1f44702738c8b0f24f2567c36da6d") c.Assert(hash.IsZero(), Equals, false) } + +func (s *HashSuite) TestNewHasher(c *C) { + content := "hasher test sample" + hasher := NewHasher(BlobObject, int64(len(content))) + hasher.Write([]byte(content)) + c.Assert(hasher.Sum().String(), Equals, "dc42c3cc80028d0ec61f0a6b24cadd1c195c4dfc") +} |