| 40 | } |
| 41 | |
| 42 | func TestMemoryList_Remove(t *testing.T) { |
| 43 | list := caches.NewMemoryList().(*caches.MemoryList) |
| 44 | _ = list.Init() |
| 45 | _ = list.Add("a", &caches.Item{ |
| 46 | Key: "a1", |
| 47 | ExpiresAt: time.Now().Unix() + 3600, |
| 48 | HeaderSize: 1024, |
| 49 | }) |
| 50 | _ = list.Add("b", &caches.Item{ |
| 51 | Key: "b1", |
| 52 | ExpiresAt: time.Now().Unix() + 3600, |
| 53 | HeaderSize: 1024, |
| 54 | }) |
| 55 | _ = list.Remove("b") |
| 56 | list.Print(t) |
| 57 | t.Log(list.Count()) |
| 58 | } |
| 59 | |
| 60 | func TestMemoryList_Purge(t *testing.T) { |
| 61 | list := caches.NewMemoryList().(*caches.MemoryList) |