test "RESP$proto: RM_ReplyWithErrorFormat: error format reply"{
catch {r rw.error_format "An error: %s" foo} e
assert_match "ERR An error: foo" $e
assert_match "An error: foo" $e;# Should not be used by a user, but compatible with RM_ReplyError
catch {r rw.error_format "-ERR An error: %s" foo2} e
assert_match "ERR An error: foo2" $e
assert_match "-ERR An error: foo2" $e;# Should not be used by a user, but compatible with RM_ReplyError (There are two hyphens, TCL removes the first one)
catch {r rw.error_format "-WRONGTYPE A type error: %s" foo3} e
assert_match "WRONGTYPE A type error: foo3" $e
assert_match "-WRONGTYPE A type error: foo3" $e ;# Should not be used by a user, but compatible with RM_ReplyError (There are two hyphens, TCL removes the first one)
catch {r rw.error_format "ERR An error: %s" foo4} e
assert_match "ERR An error: foo4" $e
catch {r rw.error_format "WRONGTYPE A type error: %s" foo5} e
test {XREAD and XREADGROUP against wrong parameter}{
r DEL mystream
r XADD mystream 666 f v
r XGROUP CREATE mystream mygroup $
assert_error "ERR Unbalanced 'xreadgroup' list of streams: for each stream key an ID or '>' must be specified."{r XREADGROUP GROUP mygroup Alice COUNT 1 STREAMS mystream }
assert_error "ERR Unbalanced 'xread' list of streams: for each stream key an ID or '$' must be specified."{r XREAD COUNT 1 STREAMS mystream }
}
test {Blocking XREAD: key deleted}{
r DEL mystream
r XADD mystream 666 f v
...
...
@@ -466,7 +474,30 @@ start_server {
$rd close
}
test {Blocking XREADGROUP for stream key that has clients blocked on list - avoid endless loop}{