shared.pong = createObject(REDIS_STRING,sdsnew("+PONG\r\n"));
shared.queued = createObject(REDIS_STRING,sdsnew("+QUEUED\r\n"));
shared.wrongtypeerr = createObject(REDIS_STRING,sdsnew(
- "-ERR Operation against a key holding the wrong kind of value\r\n"));
+ "-WRONGTYPE Operation against a key holding the wrong kind of value\r\n"));
shared.nokeyerr = createObject(REDIS_STRING,sdsnew(
"-ERR no such key\r\n"));
shared.syntaxerr = createObject(REDIS_STRING,sdsnew(
catch {r incr mylist} err
r rpop mylist
format $err
- } {ERR*}
+ } {WRONGTYPE*}
test {DECRBY over 32bit value with over 32bit increment, negative res} {
r set novar 17179869184
catch {r incrbyfloat mylist 1.0} err
r del mylist
format $err
- } {ERR*kind*}
+ } {WRONGTYPE*}
test {INCRBYFLOAT does not allow NaN or Infinity} {
r set foo 0
test "SETBIT against key with wrong type" {
r del mykey
r lpush mykey "foo"
- assert_error "*wrong kind*" {r setbit mykey 0 1}
+ assert_error "WRONGTYPE*" {r setbit mykey 0 1}
}
test "SETBIT with out of range bit offset" {
test "SETRANGE against key with wrong type" {
r del mykey
r lpush mykey "foo"
- assert_error "*wrong kind*" {r setrange mykey 0 bar}
+ assert_error "WRONGTYPE*" {r setrange mykey 0 bar}
}
test "SETRANGE with out of range offset" {
r del blist target
r set blist nolist
$rd brpoplpush blist target 1
- assert_error "ERR*wrong kind*" {$rd read}
+ assert_error "WRONGTYPE*" {$rd read}
}
test "BRPOPLPUSH with wrong destination type" {
r set target nolist
r lpush blist foo
$rd brpoplpush blist target 1
- assert_error "ERR*wrong kind*" {$rd read}
+ assert_error "WRONGTYPE*" {$rd read}
set rd [redis_deferring_client]
r del blist target
$rd brpoplpush blist target 0
after 1000
r rpush blist foo
- assert_error "ERR*wrong kind*" {$rd read}
+ assert_error "WRONGTYPE*" {$rd read}
assert_equal {foo} [r lrange blist 0 -1]
}
r set target nolist
$rd brpoplpush blist target 0
r rpush blist a b c
- assert_error "ERR*wrong kind*" {$rd read}
+ assert_error "WRONGTYPE*" {$rd read}
r lrange blist 0 -1
} {a b c}
$rd2 brpoplpush blist target2 0
r lpush blist foo
- assert_error "ERR*wrong kind*" {$rd1 read}
+ assert_error "WRONGTYPE*" {$rd1 read}
assert_equal {foo} [$rd2 read]
assert_equal {foo} [r lrange target2 0 -1]
}
r del blist1 blist2
r set blist2 nolist
$rd $pop blist1 blist2 1
- assert_error "ERR*wrong kind*" {$rd read}
+ assert_error "WRONGTYPE*" {$rd read}
}
test "$pop: timeout" {
test {LLEN against non-list value error} {
r del mylist
r set mylist foobar
- assert_error ERR* {r llen mylist}
+ assert_error WRONGTYPE* {r llen mylist}
}
test {LLEN against non existing key} {
}
test {LINDEX against non-list value error} {
- assert_error ERR* {r lindex mylist 0}
+ assert_error WRONGTYPE* {r lindex mylist 0}
}
test {LINDEX against non existing key} {
}
test {LPUSH against non-list value error} {
- assert_error ERR* {r lpush mylist 0}
+ assert_error WRONGTYPE* {r lpush mylist 0}
}
test {RPUSH against non-list value error} {
- assert_error ERR* {r rpush mylist 0}
+ assert_error WRONGTYPE* {r rpush mylist 0}
}
foreach {type large} [array get largevalue] {
test {RPOPLPUSH against non list src key} {
r del srclist dstlist
r set srclist x
- assert_error ERR* {r rpoplpush srclist dstlist}
+ assert_error WRONGTYPE* {r rpoplpush srclist dstlist}
assert_type string srclist
assert_equal 0 [r exists newlist]
}
test {RPOPLPUSH against non list dst key} {
create_ziplist srclist {a b c d}
r set dstlist x
- assert_error ERR* {r rpoplpush srclist dstlist}
+ assert_error WRONGTYPE* {r rpoplpush srclist dstlist}
assert_type string dstlist
assert_equal {a b c d} [r lrange srclist 0 -1]
}
test {LPOP/RPOP against non list value} {
r set notalist foo
- assert_error ERR*kind* {r lpop notalist}
- assert_error ERR*kind* {r rpop notalist}
+ assert_error WRONGTYPE* {r lpop notalist}
+ assert_error WRONGTYPE* {r rpop notalist}
}
foreach {type num} {ziplist 250 linkedlist 500} {
test {LSET against non list value} {
r set nolist foobar
- assert_error ERR*value* {r lset nolist 0 foo}
+ assert_error WRONGTYPE* {r lset nolist 0 foo}
}
foreach {type e} [array get largevalue] {
test {SADD against non set} {
r lpush mylist foo
- assert_error ERR*kind* {r sadd mylist bar}
+ assert_error WRONGTYPE* {r sadd mylist bar}
}
test "SADD a non-integer against an intset" {
test "SINTER against non-set should throw error" {
r set key1 x
- assert_error "ERR*wrong kind*" {r sinter key1 noset}
+ assert_error "WRONGTYPE*" {r sinter key1 noset}
}
test "SUNION against non-set should throw error" {
r set key1 x
- assert_error "ERR*wrong kind*" {r sunion key1 noset}
+ assert_error "WRONGTYPE*" {r sunion key1 noset}
}
test "SINTER should handle non existing key as empty" {
test "SMOVE wrong src key type" {
r set x 10
- assert_error "ERR*wrong kind*" {r smove x myset2 foo}
+ assert_error "WRONGTYPE*" {r smove x myset2 foo}
}
test "SMOVE wrong dst key type" {
r set x 10
- assert_error "ERR*wrong kind*" {r smove myset2 x foo}
+ assert_error "WRONGTYPE*" {r smove myset2 x foo}
}
test "SMOVE with identical source and destination" {