aboutsummaryrefslogtreecommitdiffstats
path: root/formats/packfile/objects_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'formats/packfile/objects_test.go')
-rw-r--r--formats/packfile/objects_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/formats/packfile/objects_test.go b/formats/packfile/objects_test.go
index 5952432..3d9675f 100644
--- a/formats/packfile/objects_test.go
+++ b/formats/packfile/objects_test.go
@@ -19,6 +19,12 @@ func (s *ObjectsSuite) TestComputeHash(c *C) {
c.Assert(hash.String(), Equals, "8ab686eafeb1f44702738c8b0f24f2567c36da6d")
}
+func (s *ObjectsSuite) TestNewHash(c *C) {
+ hash := ComputeHash("blob", []byte("Hello, World!\n"))
+
+ c.Assert(hash, Equals, NewHash(hash.String()))
+}
+
var CommitFixture = "dHJlZSBjMmQzMGZhOGVmMjg4NjE4ZjY1ZjZlZWQ2ZTE2OGUwZDUxNDg4NmY0CnBhcmVudCBiMDI5NTE3ZjYzMDBjMmRhMGY0YjY1MWI4NjQyNTA2Y2Q2YWFmNDVkCnBhcmVudCBiOGU0NzFmNThiY2JjYTYzYjA3YmRhMjBlNDI4MTkwNDA5YzJkYjQ3CmF1dGhvciBNw6F4aW1vIEN1YWRyb3MgPG1jdWFkcm9zQGdtYWlsLmNvbT4gMTQyNzgwMjQzNCArMDIwMApjb21taXR0ZXIgTcOheGltbyBDdWFkcm9zIDxtY3VhZHJvc0BnbWFpbC5jb20+IDE0Mjc4MDI0MzQgKzAyMDAKCk1lcmdlIHB1bGwgcmVxdWVzdCAjMSBmcm9tIGRyaXBvbGxlcy9mZWF0dXJlCgpDcmVhdGluZyBjaGFuZ2Vsb2c="
func (s *ObjectsSuite) TestParseCommit(c *C) {