Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
509c888d
Commit
509c888d
authored
Jul 18, 2014
by
antirez
Browse files
Test: Pub/Sub PING.
parent
420584a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/pubsub.tcl
View file @
509c888d
...
...
@@ -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
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment