| 70 | } |
| 71 | |
| 72 | func (s *BufferSuite) TestPutCacheOverflow(c *C) { |
| 73 | // this test only works with an specific size |
| 74 | o := s.c["two_bytes"] |
| 75 | |
| 76 | o.Put(1, s.aBuffer) |
| 77 | o.Put(2, s.cBuffer) |
| 78 | o.Put(3, s.dBuffer) |
| 79 | |
| 80 | obj, ok := o.Get(1) |
| 81 | c.Assert(ok, Equals, false) |
| 82 | c.Assert(obj, IsNil) |
| 83 | obj, ok = o.Get(2) |
| 84 | c.Assert(ok, Equals, true) |
| 85 | c.Assert(obj, NotNil) |
| 86 | obj, ok = o.Get(3) |
| 87 | c.Assert(ok, Equals, true) |
| 88 | c.Assert(obj, NotNil) |
| 89 | } |
| 90 | |
| 91 | func (s *BufferSuite) TestEvictMultipleBuffers(c *C) { |
| 92 | o := s.c["two_bytes"] |