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

Function checkScan

scan_test.go:46–67  ·  view source on GitHub ↗
(t *testing.T, c *redis.Client, tp string)

Source from the content-addressed store, hash-verified

44}
45
46func checkScan(t *testing.T, c *redis.Client, tp string) {
47 ctx := context.Background()
48 if ay, err := c.Do(ctx, "XSCAN", tp, "", "count", 5).Result(); err != nil {
49 t.Fatal(err)
50 } else if ay, ok := ay.([]interface{}); !ok || len(ay) != 2 {
51 t.Fatal(len(ay))
52 } else if n := ay[0].(string); n != "4" {
53 t.Fatal(n)
54 } else {
55 checkScanValues(t, ay[1], "0", "1", "2", "3", "4")
56 }
57
58 if ay, err := c.Do(ctx, "XSCAN", tp, "4", "count", 6).Result(); err != nil {
59 t.Fatal(err)
60 } else if ay, ok := ay.([]interface{}); !ok || len(ay) != 2 {
61 t.Fatal(len(ay))
62 } else if n := ay[0].(string); n != "" {
63 t.Fatal(n)
64 } else {
65 checkScanValues(t, ay[1], 5, 6, 7, 8, 9)
66 }
67}
68
69func testKVScan(t *testing.T, c *redis.Client) {
70 ctx := context.Background()

Callers 5

testKVScanFunction · 0.85
testHashKeyScanFunction · 0.85
testListKeyScanFunction · 0.85
testZSetKeyScanFunction · 0.85
testSetKeyScanFunction · 0.85

Calls 2

checkScanValuesFunction · 0.85
DoMethod · 0.45

Tested by

no test coverage detected