(t *testing.T)
| 300 | } |
| 301 | |
| 302 | func TestFileList_PurgeLFU(t *testing.T) { |
| 303 | if !testutils.IsSingleTesting() { |
| 304 | return |
| 305 | } |
| 306 | |
| 307 | var list = caches.NewSQLiteFileList(Tea.Root + "/data/cache-index/p1") |
| 308 | |
| 309 | defer func() { |
| 310 | _ = list.Close() |
| 311 | }() |
| 312 | |
| 313 | err := list.Init() |
| 314 | if err != nil { |
| 315 | t.Fatal(err) |
| 316 | } |
| 317 | |
| 318 | var count = 0 |
| 319 | err = list.PurgeLFU(caches.CountFileDB*2, func(hash string) error { |
| 320 | t.Log(hash) |
| 321 | count++ |
| 322 | return nil |
| 323 | }) |
| 324 | if err != nil { |
| 325 | t.Fatal(err) |
| 326 | } |
| 327 | t.Log("ok, purged", count, "items") |
| 328 | } |
| 329 | |
| 330 | func TestFileList_Stat(t *testing.T) { |
| 331 | if !testutils.IsSingleTesting() { |
nothing calls this directly
no test coverage detected