mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
feat(cmd): support for adding byte,bit parameters to the bitpos command (#2498)
Signed-off-by: monkey92t <golang@88.com>
This commit is contained in:
@ -1091,6 +1091,19 @@ var _ = Describe("Commands", func() {
|
||||
Expect(pos).To(Equal(int64(-1)))
|
||||
})
|
||||
|
||||
It("should BitPosSpan", func() {
|
||||
err := client.Set(ctx, "mykey", "\x00\xff\x00", 0).Err()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
pos, err := client.BitPosSpan(ctx, "mykey", 0, 1, 3, "byte").Result()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(pos).To(Equal(int64(16)))
|
||||
|
||||
pos, err = client.BitPosSpan(ctx, "mykey", 0, 1, 3, "bit").Result()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(pos).To(Equal(int64(1)))
|
||||
})
|
||||
|
||||
It("should BitField", func() {
|
||||
nn, err := client.BitField(ctx, "mykey", "INCRBY", "i5", 100, 1, "GET", "u4", 0).Result()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
Reference in New Issue
Block a user