Test: Pub/Sub PING.

This commit is contained in:
antirez 2014-07-18 12:03:31 +02:00
parent 420584a46d
commit 509c888dfa

View File

@ -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]