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

Function TestListStructure_LLen

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

Source from the content-addressed store, hash-verified

191}
192
193func TestListStructure_LLen(t *testing.T) {
194 list, _ := initList()
195 defer list.db.Clean()
196
197 // Test LLen function when the key exists
198 listErr = list.LPush(string(randkv.GetTestKey(1)), randkv.RandomValue(100), 0)
199 assert.Nil(t, listErr)
200 len, err := list.LLen(string(randkv.GetTestKey(1)))
201 assert.Nil(t, err)
202 assert.Equal(t, len, 1)
203
204 // Test LLen function when the key does not exist
205 _, err = list.LLen(string(randkv.GetTestKey(2)))
206 assert.Equal(t, err, _const.ErrKeyNotFound)
207}
208
209func TestListStructure_LRem(t *testing.T) {
210 list, _ := initList()

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected