diff --git a/tests/unit/pubsub.tcl b/tests/unit/pubsub.tcl index e2420830..18033bdf 100644 --- a/tests/unit/pubsub.tcl +++ b/tests/unit/pubsub.tcl @@ -47,6 +47,22 @@ start_server {tags {"pubsub"}} { __consume_subscribe_messages $client punsubscribe $channels } + test "Pub/Sub PING" { + set rd1 [redis_deferring_client] + subscribe $rd1 somechannel + # While subscribed to non-zero channels PING works in Pub/Sub mode. + $rd1 ping + $rd1 ping "foo" + set reply1 [$rd1 read] + set reply2 [$rd1 read] + unsubscribe $rd1 somechannel + # Now we are unsubscribed, PING should just return PONG. + $rd1 ping + set reply3 [$rd1 read] + $rd1 close + list $reply1 $reply2 $reply3 + } {{pong {}} {pong foo} PONG} + test "PUBLISH/SUBSCRIBE basics" { set rd1 [redis_deferring_client]