MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestFileList_Remove

Function TestFileList_Remove

internal/caches/list_file_sqlite_test.go:246–272  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

244}
245
246func 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
274func TestFileList_Purge(t *testing.T) {
275 if !testutils.IsSingleTesting() {

Callers

nothing calls this directly

Calls 8

IsSingleTestingFunction · 0.92
NewSQLiteFileListFunction · 0.92
LogMethod · 0.80
CloseMethod · 0.65
InitMethod · 0.65
OnRemoveMethod · 0.65
RemoveMethod · 0.65
CountMethod · 0.65

Tested by

no test coverage detected