mirror of https://github.com/go-redis/redis.git
Change ZWithKey
This commit is contained in:
parent
6809e07fd3
commit
58f22c56fd
|
@ -1554,8 +1554,7 @@ type Z struct {
|
||||||
|
|
||||||
// ZWithKey represents sorted set member including the name of the key where it was popped.
|
// ZWithKey represents sorted set member including the name of the key where it was popped.
|
||||||
type ZWithKey struct {
|
type ZWithKey struct {
|
||||||
Score float64
|
Z
|
||||||
Member interface{}
|
|
||||||
Key string
|
Key string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2138,8 +2138,10 @@ var _ = Describe("Commands", func() {
|
||||||
member, err := client.BZPopMax(0, "zset1", "zset2").Result()
|
member, err := client.BZPopMax(0, "zset1", "zset2").Result()
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
Expect(member).To(Equal(redis.ZWithKey{
|
Expect(member).To(Equal(redis.ZWithKey{
|
||||||
|
Z: redis.Z{
|
||||||
Score: 3,
|
Score: 3,
|
||||||
Member: "three",
|
Member: "three",
|
||||||
|
},
|
||||||
Key: "zset1",
|
Key: "zset1",
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
@ -2154,8 +2156,10 @@ var _ = Describe("Commands", func() {
|
||||||
bZPopMax := client.BZPopMax(0, "zset")
|
bZPopMax := client.BZPopMax(0, "zset")
|
||||||
Expect(bZPopMax.Err()).NotTo(HaveOccurred())
|
Expect(bZPopMax.Err()).NotTo(HaveOccurred())
|
||||||
Expect(bZPopMax.Val()).To(Equal(redis.ZWithKey{
|
Expect(bZPopMax.Val()).To(Equal(redis.ZWithKey{
|
||||||
|
Z: redis.Z{
|
||||||
Member: "a",
|
Member: "a",
|
||||||
Score: 1,
|
Score: 1,
|
||||||
|
},
|
||||||
Key: "zset",
|
Key: "zset",
|
||||||
}))
|
}))
|
||||||
done <- true
|
done <- true
|
||||||
|
@ -2216,8 +2220,10 @@ var _ = Describe("Commands", func() {
|
||||||
member, err := client.BZPopMin(0, "zset1", "zset2").Result()
|
member, err := client.BZPopMin(0, "zset1", "zset2").Result()
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
Expect(member).To(Equal(redis.ZWithKey{
|
Expect(member).To(Equal(redis.ZWithKey{
|
||||||
|
Z: redis.Z{
|
||||||
Score: 1,
|
Score: 1,
|
||||||
Member: "one",
|
Member: "one",
|
||||||
|
},
|
||||||
Key: "zset1",
|
Key: "zset1",
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
@ -2232,8 +2238,10 @@ var _ = Describe("Commands", func() {
|
||||||
bZPopMin := client.BZPopMin(0, "zset")
|
bZPopMin := client.BZPopMin(0, "zset")
|
||||||
Expect(bZPopMin.Err()).NotTo(HaveOccurred())
|
Expect(bZPopMin.Err()).NotTo(HaveOccurred())
|
||||||
Expect(bZPopMin.Val()).To(Equal(redis.ZWithKey{
|
Expect(bZPopMin.Val()).To(Equal(redis.ZWithKey{
|
||||||
|
Z: redis.Z{
|
||||||
Member: "a",
|
Member: "a",
|
||||||
Score: 1,
|
Score: 1,
|
||||||
|
},
|
||||||
Key: "zset",
|
Key: "zset",
|
||||||
}))
|
}))
|
||||||
done <- true
|
done <- true
|
||||||
|
|
Loading…
Reference in New Issue