From d2db4aa7532885fb0eaf9ce7db15af28feb66b05 Mon Sep 17 00:00:00 2001 From: Wen Hui Date: Tue, 18 Apr 2023 01:32:10 -0400 Subject: 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. --- tests/unit/type/string.tcl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') 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] -- cgit v1.2.1