1
0
mirror of https://github.com/redis/go-redis.git synced 2025-06-12 14:21:52 +03:00

Improve nil reply parsing.

This commit is contained in:
Vladimir Mihailenco
2015-12-22 11:02:18 +02:00
parent ba44d4d158
commit 9782e280cf
3 changed files with 18 additions and 22 deletions

View File

@ -1298,12 +1298,15 @@ var _ = Describe("Commands", func() {
})
It("should BRPopLPush", func() {
rPush := client.RPush("list1", "a", "b", "c")
Expect(rPush.Err()).NotTo(HaveOccurred())
_, err := client.BRPopLPush("list1", "list2", time.Second).Result()
Expect(err).To(Equal(redis.Nil))
bRPopLPush := client.BRPopLPush("list1", "list2", 0)
Expect(bRPopLPush.Err()).NotTo(HaveOccurred())
Expect(bRPopLPush.Val()).To(Equal("c"))
err = client.RPush("list1", "a", "b", "c").Err()
Expect(err).NotTo(HaveOccurred())
v, err := client.BRPopLPush("list1", "list2", 0).Result()
Expect(err).NotTo(HaveOccurred())
Expect(v).To(Equal("c"))
})
It("should LIndex", func() {