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

Function TestRpop

IceFireDB-Redis-Proxy/test/cmd_list_test.go:356–387  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

354}
355
356func TestRpop(t *testing.T) {
357 server.Clear()
358 c, err := proto.Dial(server.Addr())
359 ok(t, err)
360 defer c.Close()
361 s := server.Direct()
362 s.Push("l", "aap", "noot", "mies")
363
364 // Simple pops.
365 {
366 mustDo(t, c,
367 "RPOP", "l",
368 proto.String("mies"),
369 )
370
371 mustDo(t, c,
372 "RPOP", "l",
373 proto.String("noot"),
374 )
375
376 mustDo(t, c,
377 "RPOP", "l",
378 proto.String("aap"),
379 )
380
381 // Last element has been popped. Key is gone.
382 must0(t, c, "EXISTS", "l")
383
384 // Can pop non-existing keys just fine.
385 mustNil(t, c, "RPOP", "l")
386 }
387}
388
389func TestLindex(t *testing.T) {
390 server.Clear()

Callers

nothing calls this directly

Calls 10

ClearFunction · 0.92
DialFunction · 0.92
AddrFunction · 0.92
DirectFunction · 0.92
StringFunction · 0.92
okFunction · 0.70
mustDoFunction · 0.70
must0Function · 0.70
mustNilFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected