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

@@ -170,6 +170,8 @@ func (_ LayeredCacheTests) RemovesOldestItemWhenFull() {
Expect(cache.Get("2", "a")).To.Equal(nil)
Expect(cache.Get("3", "a").Value()).To.Equal(3)
Expect(cache.Get("xx", "b").Value()).To.Equal(9001)
Expect(cache.GetDropped()).To.Equal(4)
Expect(cache.GetDropped()).To.Equal(0)
}
func newLayered() *LayeredCache {