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:22 +0200
commit26eb7ec7312eb5aa893252de67ccd3748f02f130 (patch)
tree0d614764936155649d2bec971ff063a022aa58e5
parent73737c4b85443abe00004dd6f0b6a76d49f0b187 (diff)
downloadredis-26eb7ec7312eb5aa893252de67ccd3748f02f130.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"}
+ }
}