(t *testing.T, c *redis.Client, tp string)
| 44 | } |
| 45 | |
| 46 | func 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 | |
| 69 | func testKVScan(t *testing.T, c *redis.Client) { |
| 70 | ctx := context.Background() |
no test coverage detected