diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2015-10-25 01:43:15 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2015-10-25 01:43:15 +0200 |
commit | 3048d280d2d5b258d9e582a226ff4bbed34fd5c9 (patch) | |
tree | 3be7a88afda8d4409d30e6a7fc7b7128dabe2b45 /formats/packfile/objects_test.go | |
parent | 27aa8cdd2431068606741a589383c02c149ea625 (diff) | |
download | go-git-3048d280d2d5b258d9e582a226ff4bbed34fd5c9.tar.gz |
formats/packfile: test improvements
Diffstat (limited to 'formats/packfile/objects_test.go')
-rw-r--r-- | formats/packfile/objects_test.go | 6 |
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) { |