(c *C)
| 11 | var _ = Suite(&MemoryObjectSuite{}) |
| 12 | |
| 13 | func (s *MemoryObjectSuite) TestHash(c *C) { |
| 14 | o := &MemoryObject{} |
| 15 | o.SetType(BlobObject) |
| 16 | o.SetSize(14) |
| 17 | |
| 18 | _, err := o.Write([]byte("Hello, World!\n")) |
| 19 | c.Assert(err, IsNil) |
| 20 | |
| 21 | c.Assert(o.Hash().String(), Equals, "8ab686eafeb1f44702738c8b0f24f2567c36da6d") |
| 22 | |
| 23 | o.SetType(CommitObject) |
| 24 | c.Assert(o.Hash().String(), Equals, "8ab686eafeb1f44702738c8b0f24f2567c36da6d") |
| 25 | } |
| 26 | |
| 27 | func (s *MemoryObjectSuite) TestHashNotFilled(c *C) { |
| 28 | o := &MemoryObject{} |