Skip to content

Commit

Permalink
feat:add support for pub/sub
Browse files Browse the repository at this point in the history
Signed-off-by: daz-3ux <daz-3ux@proton.me>
  • Loading branch information
Daz-3ux committed Sep 1, 2023
1 parent 98eae25 commit d344e8a
Show file tree
Hide file tree
Showing 2 changed files with 193 additions and 0 deletions.
191 changes: 191 additions & 0 deletions cts.json
Original file line number Diff line number Diff line change
Expand Up @@ -7314,5 +7314,196 @@
0
],
"since": "6.2.0"
},
{
"name": "psubscribe command",
"command": [
"psubscribe hello"
],
"result": [
[
"psubscribe",
"hello",
1
]
],
"since": "2.0.0",
"is_pubsub": true
},
{
"name": "psubscribe with RESET",
"command": [
"psubscribe hello RESET"
],
"result": [
[
"psubscribe",
"hello",
1
]
],
"since": "6.2.0"
},
{
"name": "publish command",
"command": [
"publish hello world"
],
"result": [
0
],
"since": "2.0.0"
},
{
"name": "pubsub channels command",
"command": [
"pubsub channels hello"
],
"result": [
[]
],
"since": "2.8.0"
},
{
"name": "pubsub numpat command",
"command": [
"pubsub numpat"
],
"result": [
0
],
"since": "2.8.0"
},
{
"name": "pubsub numsub command",
"command": [
"pubsub numsub hello"
],
"result": [
[
"hello",
0
]
],
"since": "2.8.0"
},
{
"name": "pubsub shardchannels command",
"command": [
"pubsub shardchannels hello"
],
"result": [
[]
],
"since": "7.0.0"
},
{
"name": "pubsub shardnumsub command",
"command": [
"pubsub shardnumsub hello"
],
"result": [
[
"hello",
0
]
],
"since": "7.0.0"
},
{
"name": "punsubscribe command",
"command": [
"punsubscribe hello"
],
"result": [
[
"punsubscribe",
"hello",
0
]
],
"since": "2.0.0"
},
{
"name": "spublish command",
"command": [
"spublish hello world"
],
"result": [
0
],
"since": "7.0.0"
},
{
"name": "ssubscribe command",
"command": [
"ssubscribe hello"
],
"result": [
[
"ssubscribe",
"hello",
1
]
],
"since": "7.0.0",
"is_pubsub": true
},
{
"name": "subscribe command",
"command": [
"subscribe hello"
],
"result": [
[
"subscribe",
"hello",
1
]
],
"since": "2.0.0",
"is_pubsub": true
},
{
"name": "subscribe with RESET",
"command": [
"subscribe hello RESET"
],
"result": [
[
"subscribe",
"hello",
1
]
],
"since": "6.2.0"
},
{
"name": "sunsubscribe command",
"command": [
"sunsubscribe hello"
],
"result": [
[
"sunsubscribe",
"hello",
0
]
],
"since": "7.0.0"
},
{
"name": "unsubscribe command",
"command": [
"unsubscribe hello"
],
"result": [
[
"unsubscribe",
"hello",
0
]
],
"since": "2.0.0"
}
]
2 changes: 2 additions & 0 deletions redis_compatibility_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ def run_test(test):
if 'sort_result' in test and isinstance(result[idx], list):
ret = sort_nested_list(ret)
result[idx] = sort_nested_list(result[idx])
if 'is_pubsub' in test:
r.quit()
if result[idx] != ret:
test_failed(g_results[since], name, f"expected: {result[idx]}, result: {ret}")
return
Expand Down

0 comments on commit d344e8a

Please sign in to comment.