Handle evictions properly when cache is empty.

This commit is contained in:
2023-08-27 18:01:16 -07:00
parent 6fbdece4be
commit b92e16fa4d
4 changed files with 23 additions and 10 deletions

View File

@@ -20,6 +20,11 @@ func TestBasicCacheEviction(t *testing.T) {
t.Fatal("cache should have size 0")
}
c.evict()
if err := c.ConsistencyCheck(); err != nil {
t.Fatal(err)
}
c.Store("raven", 1)
if err := c.ConsistencyCheck(); err != nil {
t.Fatal(err)