summaryrefslogtreecommitdiff
path: root/tests/unit/pubsubshard.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/pubsubshard.tcl')
-rw-r--r--tests/unit/pubsubshard.tcl76
1 files changed, 0 insertions, 76 deletions
diff --git a/tests/unit/pubsubshard.tcl b/tests/unit/pubsubshard.tcl
index 5c3564afe..d0023a841 100644
--- a/tests/unit/pubsubshard.tcl
+++ b/tests/unit/pubsubshard.tcl
@@ -1,80 +1,4 @@
start_server {tags {"pubsubshard external:skip"}} {
- proc __consume_ssubscribe_messages {client type channels} {
- set numsub -1
- set counts {}
-
- for {set i [llength $channels]} {$i > 0} {incr i -1} {
- set msg [$client read]
- assert_equal $type [lindex $msg 0]
-
- # when receiving subscribe messages the channels names
- # are ordered. when receiving unsubscribe messages
- # they are unordered
- set idx [lsearch -exact $channels [lindex $msg 1]]
- if {[string match "sunsubscribe" $type]} {
- assert {$idx >= 0}
- } else {
- assert {$idx == 0}
- }
- set channels [lreplace $channels $idx $idx]
-
- # aggregate the subscription count to return to the caller
- lappend counts [lindex $msg 2]
- }
-
- # we should have received messages for channels
- assert {[llength $channels] == 0}
- return $counts
- }
-
- proc __consume_subscribe_messages {client type channels} {
- set numsub -1
- set counts {}
-
- for {set i [llength $channels]} {$i > 0} {incr i -1} {
- set msg [$client read]
- assert_equal $type [lindex $msg 0]
-
- # when receiving subscribe messages the channels names
- # are ordered. when receiving unsubscribe messages
- # they are unordered
- set idx [lsearch -exact $channels [lindex $msg 1]]
- if {[string match "unsubscribe" $type]} {
- assert {$idx >= 0}
- } else {
- assert {$idx == 0}
- }
- set channels [lreplace $channels $idx $idx]
-
- # aggregate the subscription count to return to the caller
- lappend counts [lindex $msg 2]
- }
-
- # we should have received messages for channels
- assert {[llength $channels] == 0}
- return $counts
- }
-
- proc ssubscribe {client channels} {
- $client ssubscribe {*}$channels
- __consume_ssubscribe_messages $client ssubscribe $channels
- }
-
- proc subscribe {client channels} {
- $client subscribe {*}$channels
- __consume_subscribe_messages $client subscribe $channels
- }
-
- proc sunsubscribe {client {channels {}}} {
- $client sunsubscribe {*}$channels
- __consume_subscribe_messages $client sunsubscribe $channels
- }
-
- proc unsubscribe {client {channels {}}} {
- $client unsubscribe {*}$channels
- __consume_subscribe_messages $client unsubscribe $channels
- }
-
test "SPUBLISH/SSUBSCRIBE basics" {
set rd1 [redis_deferring_client]