MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / TestListStructure_LRem

Function TestListStructure_LRem

structure/list_test.go:209–222  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

207}
208
209func TestListStructure_LRem(t *testing.T) {
210 list, _ := initList()
211 defer list.db.Clean()
212
213 // Test LRem function when the key exists
214 listErr = list.LPush(string(randkv.GetTestKey(1)), randkv.RandomValue(100), 0)
215 assert.Nil(t, listErr)
216 listErr = list.LRem(string(randkv.GetTestKey(1)), 1, randkv.RandomValue(100))
217 assert.Nil(t, listErr)
218
219 // Test LRem function when the key does not exist
220 listErr = list.LRem(string(randkv.GetTestKey(2)), 1, randkv.RandomValue(100))
221 assert.Equal(t, listErr, _const.ErrKeyNotFound)
222}
223
224func TestListStructure_LSet(t *testing.T) {
225 list, _ := initList()

Callers

nothing calls this directly

Calls 6

GetTestKeyFunction · 0.92
RandomValueFunction · 0.92
initListFunction · 0.85
LPushMethod · 0.65
LRemMethod · 0.65
CleanMethod · 0.45

Tested by

no test coverage detected