| 17 | ) |
| 18 | |
| 19 | func TestMemoryList_Add(t *testing.T) { |
| 20 | list := caches.NewMemoryList().(*caches.MemoryList) |
| 21 | _ = list.Init() |
| 22 | _ = list.Add("a", &caches.Item{ |
| 23 | Key: "a1", |
| 24 | ExpiresAt: time.Now().Unix() + 3600, |
| 25 | HeaderSize: 1024, |
| 26 | }) |
| 27 | _ = list.Add("b", &caches.Item{ |
| 28 | Key: "b1", |
| 29 | ExpiresAt: time.Now().Unix() + 3600, |
| 30 | HeaderSize: 1024, |
| 31 | }) |
| 32 | _ = list.Add("123456", &caches.Item{ |
| 33 | Key: "c1", |
| 34 | ExpiresAt: time.Now().Unix() + 3600, |
| 35 | HeaderSize: 1024, |
| 36 | }) |
| 37 | t.Log(list.Prefixes()) |
| 38 | logs.PrintAsJSON(list.ItemMaps(), t) |
| 39 | t.Log(list.Count()) |
| 40 | } |
| 41 | |
| 42 | func TestMemoryList_Remove(t *testing.T) { |
| 43 | list := caches.NewMemoryList().(*caches.MemoryList) |