Commit 0b2cbf13 authored by Binbin's avatar Binbin Committed by Oran Agra
Browse files

Update sort_ro reply_schema to mention the null reply (#12534)

Also added a test to cover this case, so this can
cover the reply schemas check.

(cherry picked from commit 9ce8c54d)
parent 9e505e6c
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
"type": "string" "type": "string"
}, },
{ {
"description": "GET option is specified, but no object was found ", "description": "GET option is specified, but no object was found",
"type": "null" "type": "null"
} }
] ]
......
...@@ -117,7 +117,15 @@ ...@@ -117,7 +117,15 @@
"description": "a list of sorted elements", "description": "a list of sorted elements",
"type": "array", "type": "array",
"items": { "items": {
"oneOf": [
{
"type": "string" "type": "string"
},
{
"description": "GET option is specified, but no object was found",
"type": "null"
}
]
} }
} }
} }
......
...@@ -75,12 +75,14 @@ start_server { ...@@ -75,12 +75,14 @@ start_server {
assert_equal [lsort -integer $result] [r sort tosort GET #] assert_equal [lsort -integer $result] [r sort tosort GET #]
} {} {cluster:skip} } {} {cluster:skip}
test "SORT GET <const>" { foreach command {SORT SORT_RO} {
test "$command GET <const>" {
r del foo r del foo
set res [r sort tosort GET foo] set res [r $command tosort GET foo]
assert_equal 16 [llength $res] assert_equal 16 [llength $res]
foreach item $res { assert_equal {} $item } foreach item $res { assert_equal {} $item }
} {} {cluster:skip} } {} {cluster:skip}
}
test "SORT GET (key and hash) with sanity check" { test "SORT GET (key and hash) with sanity check" {
set l1 [r sort tosort GET # GET weight_*] set l1 [r sort tosort GET # GET weight_*]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment