| 92 | } |
| 93 | |
| 94 | func (s *ObjectSuite) TestEvictMultipleObjects(c *C) { |
| 95 | o := s.c["two_bytes"] |
| 96 | |
| 97 | o.Put(s.cObject) |
| 98 | o.Put(s.dObject) // now cache is full with two objects |
| 99 | o.Put(s.eObject) // this put should evict all previous objects |
| 100 | |
| 101 | obj, ok := o.Get(s.cObject.Hash()) |
| 102 | c.Assert(ok, Equals, false) |
| 103 | c.Assert(obj, IsNil) |
| 104 | obj, ok = o.Get(s.dObject.Hash()) |
| 105 | c.Assert(ok, Equals, false) |
| 106 | c.Assert(obj, IsNil) |
| 107 | obj, ok = o.Get(s.eObject.Hash()) |
| 108 | c.Assert(ok, Equals, true) |
| 109 | c.Assert(obj, NotNil) |
| 110 | } |
| 111 | |
| 112 | func (s *ObjectSuite) TestClear(c *C) { |
| 113 | for _, o := range s.c { |