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

Implemented PFADD, PFCOUNT, PFMERGE

This commit is contained in:
Cosmin Luță
2015-11-04 09:34:58 +02:00
parent 05394bee7c
commit 43603e1ea4
2 changed files with 53 additions and 0 deletions

View File

@ -1190,6 +1190,27 @@ var _ = Describe("Commands", func() {
})
Describe("hyperloglog", func() {
It("should PFMerge", func() {
pfAdd := client.PFAdd("hll1", "1", "2", "3", "4", "5")
Expect(pfAdd.Err()).NotTo(HaveOccurred())
pfCount := client.PFCount("hll1")
Expect(pfCount.Err()).NotTo(HaveOccurred())
Expect(pfCount.Val()).To(Equal(int64(5)))
pfAdd = client.PFAdd("hll2", "a", "b", "c", "d", "e")
Expect(pfAdd.Err()).NotTo(HaveOccurred())
pfMerge := client.PFMerge("hllMerged", "hll1", "hll2")
Expect(pfMerge.Err()).NotTo(HaveOccurred())
pfCount = client.PFCount("hllMerged")
Expect(pfCount.Err()).NotTo(HaveOccurred())
Expect(pfCount.Val()).To(Equal(int64(10)))
})
})
Describe("lists", func() {
It("should BLPop", func() {