(t *testing.T)
| 205 | } |
| 206 | |
| 207 | func TestClear(t *testing.T) { |
| 208 | cache := NewLRUCache(100) |
| 209 | value := &CacheValue{1} |
| 210 | key := "key" |
| 211 | |
| 212 | cache.Set(key, value) |
| 213 | cache.Clear() |
| 214 | |
| 215 | if _, sz, _, _, _ := cache.StatsOld(); sz != 0 { |
| 216 | t.Errorf("cache.Size() = %v, expected 0 after Clear()", sz) |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | func TestCapacityIsObeyed(t *testing.T) { |
| 221 | size := int64(3) |
nothing calls this directly
no test coverage detected