diff options
author | Wen Hui <wen.hui.ware@gmail.com> | 2023-04-18 01:32:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 08:32:10 +0300 |
commit | d2db4aa7532885fb0eaf9ce7db15af28feb66b05 (patch) | |
tree | 673408dc839e739a6612c9b6d8f416c8fd95eedf | |
parent | 644d94558a739656f81343f3b8a12205d53eeeb7 (diff) | |
download | redis-d2db4aa7532885fb0eaf9ce7db15af28feb66b05.tar.gz |
Added getrange missing testcase (#12061)
Minor test case addition.
Currently GETRANGE command does not have the test case coverage for the scenarios:
An error is returned when key exists but of different type
Added missing test cases for getrange command.
-rw-r--r-- | tests/unit/type/string.tcl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unit/type/string.tcl b/tests/unit/type/string.tcl index 744937b35..7a5d56f82 100644 --- a/tests/unit/type/string.tcl +++ b/tests/unit/type/string.tcl @@ -438,6 +438,11 @@ start_server {tags {"string"}} { assert_equal "" [r getrange mykey 0 -1] } + test "GETRANGE against wrong key type" { + r lpush lkey1 "list" + assert_error {WRONGTYPE Operation against a key holding the wrong kind of value*} {r getrange lkey1 0 -1} + } + test "GETRANGE against string value" { r set mykey "Hello World" assert_equal "Hell" [r getrange mykey 0 3] |