diff --git a/src/commands/sort.json b/src/commands/sort.json index 5e117c950..d5f651114 100644 --- a/src/commands/sort.json +++ b/src/commands/sort.json @@ -150,7 +150,7 @@ "type": "string" }, { - "description": "GET option is specified, but no object was found ", + "description": "GET option is specified, but no object was found", "type": "null" } ] diff --git a/src/commands/sort_ro.json b/src/commands/sort_ro.json index 8b32b17fa..04cc3c841 100644 --- a/src/commands/sort_ro.json +++ b/src/commands/sort_ro.json @@ -117,7 +117,15 @@ "description": "a list of sorted elements", "type": "array", "items": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "description": "GET option is specified, but no object was found", + "type": "null" + } + ] } } } diff --git a/tests/unit/sort.tcl b/tests/unit/sort.tcl index d4927cf84..109f6615e 100644 --- a/tests/unit/sort.tcl +++ b/tests/unit/sort.tcl @@ -75,12 +75,14 @@ start_server { assert_equal [lsort -integer $result] [r sort tosort GET #] } {} {cluster:skip} - test "SORT GET " { +foreach command {SORT SORT_RO} { + test "$command GET " { r del foo - set res [r sort tosort GET foo] + set res [r $command tosort GET foo] assert_equal 16 [llength $res] foreach item $res { assert_equal {} $item } } {} {cluster:skip} +} test "SORT GET (key and hash) with sanity check" { set l1 [r sort tosort GET # GET weight_*]