Unverified Commit 4375b01c authored by Wen Hui's avatar Wen Hui Committed by GitHub
Browse files

Adding missing test cases for substring (#12039)

There is are some missing test cases for SUBSTR command.
These might already be covered by GETRANGE, but no harm in adding them since they're simple.

Added 3 test case.

* start > stop
* start and stop both greater than string length
* when no key is present.
parent bc82309c
...@@ -474,6 +474,9 @@ start_server {tags {"string"}} { ...@@ -474,6 +474,9 @@ start_server {tags {"string"}} {
assert_equal "a" [r substr key 0 0] assert_equal "a" [r substr key 0 0]
assert_equal "abcd" [r substr key 0 3] assert_equal "abcd" [r substr key 0 3]
assert_equal "bcde" [r substr key -4 -1] assert_equal "bcde" [r substr key -4 -1]
assert_equal "" [r substr key -1 -3]
assert_equal "" [r substr key 7 8]
assert_equal "" [r substr nokey 0 1]
} }
if {[string match {*jemalloc*} [s mem_allocator]]} { if {[string match {*jemalloc*} [s mem_allocator]]} {
......
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