(key []byte, index int64, v int)
| 16 | ) |
| 17 | |
| 18 | func testListIndex(key []byte, index int64, v int) error { |
| 19 | c := getTestConn() |
| 20 | ctx := context.Background() |
| 21 | |
| 22 | n, err := c.Do(ctx, "lindex", key, index).Int() |
| 23 | if err == redis.Nil && v != 0 { |
| 24 | return fmt.Errorf("must nil") |
| 25 | } else if err != nil && err != redis.Nil { |
| 26 | r, _ := c.Do(ctx, "lindex", key, index).Result() |
| 27 | log.Println("lindex err: ", spew.Sdump(r)) |
| 28 | return err |
| 29 | } else if n != v { |
| 30 | return fmt.Errorf("index err number %d != %d", n, v) |
| 31 | } |
| 32 | |
| 33 | return nil |
| 34 | } |
| 35 | |
| 36 | func testListRange(key []byte, start int64, stop int64, checkValues ...int) error { |
| 37 | c := getTestConn() |
no test coverage detected