diff options
author | Wen Hui <wen.hui.ware@gmail.com> | 2023-05-01 14:00:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-01 21:00:07 +0300 |
commit | f32d1817e3b133d8e754304ef745e4d40661af24 (patch) | |
tree | 348ba35d71443f5a9089b39db9f869c726a63a53 | |
parent | d659c734569be4ed32a270bac2527ccf35418c43 (diff) | |
download | redis-f32d1817e3b133d8e754304ef745e4d40661af24.tar.gz |
Updating missing test cases for Hash commands (#12116)
Adding missing test case against wrong type for HRANDFIELD HGET HGETALL HDEL HINCRBY HINCRBYFLOAT HSTRLEN.
-rw-r--r-- | tests/unit/type/hash.tcl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/unit/type/hash.tcl b/tests/unit/type/hash.tcl index 17e3ba40b..4cff0f244 100644 --- a/tests/unit/type/hash.tcl +++ b/tests/unit/type/hash.tcl @@ -350,9 +350,16 @@ start_server {tags {"hash"}} { set _ $rv } {{{} {}} {{} {}} {{} {}}} - test {HMGET against wrong type} { + test {HMGET HRANDFIELD HGET HGETALL HDEL HINCRBY HINCRBYFLOAT HSTRLEN against wrong type} { r set wrongtype somevalue - assert_error "*wrong*" {r hmget wrongtype field1 field2} + assert_error "WRONGTYPE Operation against a key*" {r hmget wrongtype field1 field2} + assert_error "WRONGTYPE Operation against a key*" {r hrandfield wrongtype} + assert_error "WRONGTYPE Operation against a key*" {r hget wrongtype field1} + assert_error "WRONGTYPE Operation against a key*" {r hgetall wrongtype} + assert_error "WRONGTYPE Operation against a key*" {r hdel wrongtype field1} + assert_error "WRONGTYPE Operation against a key*" {r hincrby wrongtype field1 2} + assert_error "WRONGTYPE Operation against a key*" {r hincrbyfloat wrongtype field1 2.5} + assert_error "WRONGTYPE Operation against a key*" {r hstrlen wrongtype field1} } test {HMGET - small hash} { |