]>
git.saurik.com Git - redis.git/blob - tests/unit/quit.tcl
1 start_server
{tags
{"quit"}} {
2 proc format_command
{args
} {
3 set cmd
"*[llength $args]\r\n"
5 append cmd
"$[string length $a]\r\n$a\r\n"
10 test
"QUIT returns OK" {
12 assert_equal OK
[r quit
]
13 assert_error
* {r ping
}
16 test
"Pipelined commands after QUIT must not be executed" {
18 r write
[format_command quit
]
19 r write
[format_command
set foo bar
]
21 assert_equal OK
[r
read]
22 assert_error
* {r
read}
25 assert_equal
{} [r get foo
]
28 test
"Pipelined commands after QUIT that exceed read buffer size" {
30 r write
[format_command quit
]
31 r write
[format_command
set foo
[string repeat
"x" 1024]]
33 assert_equal OK
[r
read]
34 assert_error
* {r
read}
37 assert_equal
{} [r get foo
]