summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWen Hui <wen.hui.ware@gmail.com>2023-05-07 04:46:11 -0400
committerGitHub <noreply@github.com>2023-05-07 11:46:11 +0300
commit42dd98ec191fd71528785bd7d31bd18112078f66 (patch)
treed7f708cb3e5ee701bd92f1ea71baabbb9181fbec
parentce5f4ea3a9f4afe1c43079c93d0ff6bf6b04597a (diff)
downloadredis-42dd98ec191fd71528785bd7d31bd18112078f66.tar.gz
adding missing test cases GET and GETEX (#12125)
adding test case of expired key or not exist for GET and GETEX. for better test coverage.
-rw-r--r--tests/unit/type/string.tcl8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/type/string.tcl b/tests/unit/type/string.tcl
index 7a5d56f82..68c360b97 100644
--- a/tests/unit/type/string.tcl
+++ b/tests/unit/type/string.tcl
@@ -151,6 +151,14 @@ start_server {tags {"string"}} {
set ex
} {*syntax*}
+ test "GETEX and GET expired key or not exist" {
+ r del foo
+ r set foo bar px 1
+ after 2
+ assert_equal {} [r getex foo]
+ assert_equal {} [r get foo]
+ }
+
test "GETEX no arguments" {
set ex {}
catch {r getex} ex