summaryrefslogtreecommitdiff
path: root/tests/unit/pubsub.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/pubsub.tcl')
-rw-r--r--tests/unit/pubsub.tcl13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/pubsub.tcl b/tests/unit/pubsub.tcl
index 4435a9b1d..ea8964cf3 100644
--- a/tests/unit/pubsub.tcl
+++ b/tests/unit/pubsub.tcl
@@ -390,4 +390,17 @@ start_server {tags {"pubsub network"}} {
r config set notify-keyspace-events EA
assert_equal {AE} [lindex [r config get notify-keyspace-events] 1]
}
+
+ test "Keyspace notifications: new key test" {
+ r config set notify-keyspace-events En
+ set rd1 [redis_deferring_client]
+ assert_equal {1} [psubscribe $rd1 *]
+ r set foo bar
+ # second set of foo should not cause a 'new' event
+ r set foo baz
+ r set bar bar
+ assert_equal "pmessage * __keyevent@${db}__:new foo" [$rd1 read]
+ assert_equal "pmessage * __keyevent@${db}__:new bar" [$rd1 read]
+ $rd1 close
+ }
}