(t *testing.T)
| 244 | } |
| 245 | |
| 246 | func TestFileList_Remove(t *testing.T) { |
| 247 | if !testutils.IsSingleTesting() { |
| 248 | return |
| 249 | } |
| 250 | |
| 251 | var list = caches.NewSQLiteFileList(Tea.Root + "/data/cache-index/p1").(*caches.SQLiteFileList) |
| 252 | defer func() { |
| 253 | _ = list.Close() |
| 254 | }() |
| 255 | |
| 256 | err := list.Init() |
| 257 | if err != nil { |
| 258 | t.Fatal(err) |
| 259 | } |
| 260 | |
| 261 | list.OnRemove(func(item *caches.Item) { |
| 262 | t.Logf("remove %#v", item) |
| 263 | }) |
| 264 | err = list.Remove(stringutil.Md5("123456")) |
| 265 | if err != nil { |
| 266 | t.Fatal(err) |
| 267 | } |
| 268 | t.Log("ok") |
| 269 | |
| 270 | t.Log("===count===") |
| 271 | t.Log(list.Count()) |
| 272 | } |
| 273 | |
| 274 | func TestFileList_Purge(t *testing.T) { |
| 275 | if !testutils.IsSingleTesting() { |
nothing calls this directly
no test coverage detected