Commit bf79c0cd authored by antirez's avatar antirez
Browse files

Added tests for [SHZ]SCAN with MATCH.

parent f56f78d1
...@@ -205,4 +205,25 @@ start_server {tags {"scan"}} { ...@@ -205,4 +205,25 @@ start_server {tags {"scan"}} {
set res [r sscan set 0 MATCH *1* COUNT 100] set res [r sscan set 0 MATCH *1* COUNT 100]
assert_equal [lsort -unique [lindex $res 1]] {1} assert_equal [lsort -unique [lindex $res 1]] {1}
} }
test "SSCAN with PATTERN" {
r del mykey
r sadd mykey foo fab fiz foobar 1 2 3 4
set res [r sscan mykey 0 MATCH foo* COUNT 10000]
lsort -unique [lindex $res 1]
} {foo foobar}
test "HSCAN with PATTERN" {
r del mykey
r hmset mykey foo 1 fab 2 fiz 3 foobar 10 1 a 2 b 3 c 4 d
set res [r hscan mykey 0 MATCH foo* COUNT 10000]
lsort -unique [lindex $res 1]
} {1 10 foo foobar}
test "ZSCAN with PATTERN" {
r del mykey
r zadd mykey 1 foo 2 fab 3 fiz 10 foobar
set res [r zscan mykey 0 MATCH foo* COUNT 10000]
lsort -unique [lindex $res 1]
}
} }
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