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
8b8f05c8
Unverified
Commit
8b8f05c8
authored
Sep 03, 2021
by
Madelyn Olson
Committed by
GitHub
Sep 03, 2021
Browse files
Add test verifying PUBSUB NUMPAT behavior (#9209)
parent
6aa2285e
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/pubsub.tcl
View file @
8b8f05c8
...
...
@@ -158,6 +158,24 @@ start_server {tags {"pubsub network"}} {
r pubsub numsub abc def
}
{
abc 0 def 0
}
test
"NUMPATs returns the number of unique patterns"
{
set rd1
[
redis_deferring_client
]
set rd2
[
redis_deferring_client
]
# Three unique patterns and one that overlaps
psubscribe $rd1
"foo*"
psubscribe $rd2
"foo*"
psubscribe $rd1
"bar*"
psubscribe $rd2
"baz*"
set patterns
[
r pubsub numpat
]
# clean up clients
punsubscribe $rd1
punsubscribe $rd2
assert_equal 3 $patterns
}
test
"Mix SUBSCRIBE and PSUBSCRIBE"
{
set rd1
[
redis_deferring_client
]
assert_equal
{
1
}
[
subscribe $rd1
{
foo.bar
}]
...
...
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