(t *testing.T)
| 272 | } |
| 273 | |
| 274 | func TestFileList_Purge(t *testing.T) { |
| 275 | if !testutils.IsSingleTesting() { |
| 276 | return |
| 277 | } |
| 278 | |
| 279 | var list = caches.NewSQLiteFileList(Tea.Root + "/data/cache-index/p1") |
| 280 | |
| 281 | defer func() { |
| 282 | _ = list.Close() |
| 283 | }() |
| 284 | |
| 285 | err := list.Init() |
| 286 | if err != nil { |
| 287 | t.Fatal(err) |
| 288 | } |
| 289 | |
| 290 | var count = 0 |
| 291 | _, err = list.Purge(caches.CountFileDB*2, func(hash string) error { |
| 292 | t.Log(hash) |
| 293 | count++ |
| 294 | return nil |
| 295 | }) |
| 296 | if err != nil { |
| 297 | t.Fatal(err) |
| 298 | } |
| 299 | t.Log("ok, purged", count, "items") |
| 300 | } |
| 301 | |
| 302 | func TestFileList_PurgeLFU(t *testing.T) { |
| 303 | if !testutils.IsSingleTesting() { |
nothing calls this directly
no test coverage detected