From a9e62ab9faee3d18478df8583d2bbb2eabfc3cef Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 19 May 2014 15:44:04 +0200 Subject: [PATCH] HyperLogLog regression test for issue #1762. --- tests/unit/hyperloglog.tcl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/unit/hyperloglog.tcl b/tests/unit/hyperloglog.tcl index af86e68e..3f514207 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"} + } }