8
8
"math"
9
9
)
10
10
11
- var _ = FDescribe ("Probabilistic commands" , Label ("probabilistic" ), func () {
11
+ var _ = Describe ("Probabilistic commands" , Label ("probabilistic" ), func () {
12
12
ctx := context .TODO ()
13
13
var client * redis.Client
14
14
@@ -32,7 +32,7 @@ var _ = FDescribe("Probabilistic commands", Label("probabilistic"), func() {
32
32
33
33
Expect (err ).NotTo (HaveOccurred ())
34
34
Expect (resultInfo ).To (BeAssignableToTypeOf (redis.BFInfo {}))
35
- Expect (resultInfo .NumItemsInserted ).To (BeEquivalentTo (int64 (1 )))
35
+ Expect (resultInfo .ItemsInserted ).To (BeEquivalentTo (int64 (1 )))
36
36
})
37
37
38
38
It ("should BFCard" , Label ("bloom" , "bfcard" ), func () {
@@ -77,13 +77,32 @@ var _ = FDescribe("Probabilistic commands", Label("probabilistic"), func() {
77
77
Expect (result .Capacity ).To (BeEquivalentTo (int64 (2000 )))
78
78
})
79
79
80
- It ("should BFInfoArg " , Label ("bloom" , "bfinfoarg " ), func () {
80
+ It ("should BFInfoCapacity, BFInfoSize, BFInfoFilters, BFInfoItems, BFInfoExpansion, " , Label ("bloom" , "bfinfocapacity" , "bfinfosize" , "bfinfofilters" , "bfinfoitems" , "bfinfoexpansion " ), func () {
81
81
err := client .BFReserve (ctx , "testbf1" , 0.001 , 2000 ).Err ()
82
82
Expect (err ).NotTo (HaveOccurred ())
83
83
84
- result , err := client .BFInfoArg (ctx , "testbf1" , redis . BFCAPACITY ).Result ()
84
+ result , err := client .BFInfoCapacity (ctx , "testbf1" ).Result ()
85
85
Expect (err ).NotTo (HaveOccurred ())
86
86
Expect (result .Capacity ).To (BeEquivalentTo (int64 (2000 )))
87
+
88
+ result , err = client .BFInfoItems (ctx , "testbf1" ).Result ()
89
+ Expect (err ).NotTo (HaveOccurred ())
90
+ Expect (result .ItemsInserted ).To (BeEquivalentTo (int64 (0 )))
91
+
92
+ result , err = client .BFInfoSize (ctx , "testbf1" ).Result ()
93
+ Expect (err ).NotTo (HaveOccurred ())
94
+ Expect (result .Size ).To (BeEquivalentTo (int64 (4056 )))
95
+
96
+ err = client .BFReserveExpansion (ctx , "testbf2" , 0.001 , 2000 , 3 ).Err ()
97
+ Expect (err ).NotTo (HaveOccurred ())
98
+
99
+ result , err = client .BFInfoFilters (ctx , "testbf2" ).Result ()
100
+ Expect (err ).NotTo (HaveOccurred ())
101
+ Expect (result .Filters ).To (BeEquivalentTo (int64 (1 )))
102
+
103
+ result , err = client .BFInfoExpansion (ctx , "testbf2" ).Result ()
104
+ Expect (err ).NotTo (HaveOccurred ())
105
+ Expect (result .ExpansionRate ).To (BeEquivalentTo (int64 (3 )))
87
106
})
88
107
89
108
It ("should BFInsert" , Label ("bloom" , "bfinsert" ), func () {
@@ -132,7 +151,7 @@ var _ = FDescribe("Probabilistic commands", Label("probabilistic"), func() {
132
151
133
152
Expect (err ).NotTo (HaveOccurred ())
134
153
Expect (resultInfo ).To (BeAssignableToTypeOf (redis.BFInfo {}))
135
- Expect (resultInfo .NumItemsInserted ).To (BeEquivalentTo (int64 (3 )))
154
+ Expect (resultInfo .ItemsInserted ).To (BeEquivalentTo (int64 (3 )))
136
155
})
137
156
138
157
It ("should BFMExists" , Label ("bloom" , "bfmexists" ), func () {
@@ -611,7 +630,7 @@ var _ = FDescribe("Probabilistic commands", Label("probabilistic"), func() {
611
630
Expect (info .Compression ).To (BeEquivalentTo (int64 (2000 )))
612
631
})
613
632
614
- FIt ("should TDigestMerge" , Label ("tdigest" , "tmerge" ), func () {
633
+ It ("should TDigestMerge" , Label ("tdigest" , "tmerge" ), func () {
615
634
err := client .TDigestCreate (ctx , "tdigest1" ).Err ()
616
635
Expect (err ).NotTo (HaveOccurred ())
617
636
err = client .TDigestAdd (ctx , "tdigest1" , 10 , 20 , 30 , 40 , 50 , 60 , 70 , 80 , 90 , 100 ).Err ()
0 commit comments