2024-03-21 09:30:47 -04:00
|
|
|
# SPDX-FileCopyrightText: 2024 Redict Contributors
|
|
|
|
# SPDX-FileCopyrightText: 2024 Salvatore Sanfilippo <antirez at gmail dot com>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2024-03-21 15:11:44 -04:00
|
|
|
# SPDX-License-Identifier: LGPL-3.0-only
|
2024-03-21 09:30:47 -04:00
|
|
|
|
2010-10-15 06:54:53 -04:00
|
|
|
start_server {tags {"quit"}} {
|
|
|
|
|
|
|
|
test "QUIT returns OK" {
|
|
|
|
reconnect
|
|
|
|
assert_equal OK [r quit]
|
|
|
|
assert_error * {r ping}
|
|
|
|
}
|
|
|
|
|
|
|
|
test "Pipelined commands after QUIT must not be executed" {
|
|
|
|
reconnect
|
|
|
|
r write [format_command quit]
|
|
|
|
r write [format_command set foo bar]
|
|
|
|
r flush
|
|
|
|
assert_equal OK [r read]
|
|
|
|
assert_error * {r read}
|
|
|
|
|
|
|
|
reconnect
|
|
|
|
assert_equal {} [r get foo]
|
|
|
|
}
|
|
|
|
|
|
|
|
test "Pipelined commands after QUIT that exceed read buffer size" {
|
|
|
|
reconnect
|
|
|
|
r write [format_command quit]
|
|
|
|
r write [format_command set foo [string repeat "x" 1024]]
|
|
|
|
r flush
|
|
|
|
assert_equal OK [r read]
|
|
|
|
assert_error * {r read}
|
|
|
|
|
|
|
|
reconnect
|
|
|
|
assert_equal {} [r get foo]
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|