add GetDropped function

This commit is contained in:
Karl Seguin
2020-02-05 22:05:05 +08:00
parent 78289f8f0b
commit 1a257a89d6
4 changed files with 60 additions and 21 deletions

View File

@@ -156,6 +156,8 @@ func (_ CacheTests) RemovesOldestItemWhenFullBySizer() {
Expect(cache.Get("2")).To.Equal(nil)
Expect(cache.Get("3")).To.Equal(nil)
Expect(cache.Get("4").Value().(*SizedItem).id).To.Equal(4)
Expect(cache.GetDropped()).To.Equal(4)
Expect(cache.GetDropped()).To.Equal(0)
}
func (_ CacheTests) SetUpdatesSizeOnDelta() {