summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-05-19 15:44:04 +0200
committerantirez <antirez@gmail.com>2014-05-19 15:45:24 +0200
commitad935769aee0c8ab3c9df1e23c7b4d308d5babb7 (patch)
tree5dae0e3d04c4e1d2edb789099cb24b4e5942000f
parent43278af63efb88a34aa2a0b21f956afcf7951d21 (diff)
downloadredis-ad935769aee0c8ab3c9df1e23c7b4d308d5babb7.tar.gz
HyperLogLog regression test for issue #1762.
-rw-r--r--tests/unit/hyperloglog.tcl11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/hyperloglog.tcl b/tests/unit/hyperloglog.tcl
index af86e68e5..3f5142076 100644
--- a/tests/unit/hyperloglog.tcl
+++ b/tests/unit/hyperloglog.tcl
@@ -156,4 +156,15 @@ start_server {tags {"hll"}} {
r pfadd hll 1 2 3
llength [r pfdebug getreg hll]
} {16384}
+
+ test {PFADD / PFCOUNT cache invalidation works} {
+ r del hll
+ r pfadd hll a b c
+ r pfcount hll
+ assert {[r getrange hll 15 15] eq "\x00"}
+ r pfadd hll a b c
+ assert {[r getrange hll 15 15] eq "\x00"}
+ r pfadd hll 1 2 3
+ assert {[r getrange hll 15 15] eq "\x80"}
+ }
}