projects
/
redis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
72dff2c
)
tests for variadic list push
author
antirez
<antirez@gmail.com>
Fri, 15 Apr 2011 14:52:07 +0000
(16:52 +0200)
committer
antirez
<antirez@gmail.com>
Fri, 15 Apr 2011 14:52:07 +0000
(16:52 +0200)
tests/unit/type/list.tcl
patch
|
blob
|
blame
|
history
diff --git
a/tests/unit/type/list.tcl
b/tests/unit/type/list.tcl
index 6b128b726974107de7dec74f3507d8719568f0e4..b6055b2660916e199f378679ed7094b910e5b529 100644
(file)
--- a/
tests/unit/type/list.tcl
+++ b/
tests/unit/type/list.tcl
@@
-55,6
+55,13
@@
start_server {
assert_equal $largevalue(linkedlist) [r lindex mylist2 2]
}
assert_equal $largevalue(linkedlist) [r lindex mylist2 2]
}
+ test {Variadic RPUSH/LPUSH} {
+ r del mylist
+ assert_equal 4 [r lpush mylist a b c d]
+ assert_equal 8 [r rpush mylist 0 1 2 3]
+ assert_equal {d c b a 0 1 2 3} [r lrange mylist 0 -1]
+ }
+
test {DEL a list - ziplist} {
assert_equal 1 [r del myziplist2]
assert_equal 0 [r exists myziplist2]
test {DEL a list - ziplist} {
assert_equal 1 [r del myziplist2]
assert_equal 0 [r exists myziplist2]
@@
-142,6
+149,15
@@
start_server {
}
}
}
}
+ test "BLPOP with variadic LPUSH" {
+ set rd [redis_deferring_client]
+ r del blist target
+ $rd blpop blist 0
+ assert_equal 2 [r lpush blist foo bar]
+ assert_equal {blist foo} [$rd read]
+ assert_equal bar [lindex [r lrange blist 0 -1] 0]
+ }
+
test "BRPOPLPUSH with zero timeout should block indefinitely" {
set rd [redis_deferring_client]
r del blist target
test "BRPOPLPUSH with zero timeout should block indefinitely" {
set rd [redis_deferring_client]
r del blist target