MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / TestListMPush

Function TestListMPush

lists_test.go:214–238  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

212}
213
214func TestListMPush(t *testing.T) {
215 c := getTestConn()
216 ctx := context.Background()
217
218 key := []byte("b")
219 if n, err := c.Do(ctx, "rpush", key, 1, 2, 3).Int64(); err != nil {
220 t.Fatal(err)
221 } else if n != 3 {
222 t.Fatal(n)
223 }
224
225 if err := testListRange(key, 0, 3, 1, 2, 3); err != nil {
226 t.Fatal(err)
227 }
228
229 if n, err := c.Do(ctx, "lpush", key, 1, 2, 3).Int64(); err != nil {
230 t.Fatal(err)
231 } else if n != 6 {
232 t.Fatal(n)
233 }
234
235 if err := testListRange(key, 0, 6, 3, 2, 1, 1, 2, 3); err != nil {
236 t.Fatal(err)
237 }
238}
239
240func TestPop(t *testing.T) {
241 c := getTestConn()

Callers

nothing calls this directly

Calls 3

getTestConnFunction · 0.85
testListRangeFunction · 0.85
DoMethod · 0.45

Tested by

no test coverage detected