1
0
mirror of https://github.com/fluencelabs/redis synced 2025-07-26 14:01:56 +00:00
Files
deps
src
tests
assets
cluster
helpers
integration
sentinel
support
tmp
unit
type
aofrw.tcl
auth.tcl
bitops.tcl
dump.tcl
expire.tcl
geo.tcl
hyperloglog.tcl
introspection.tcl
keyspace.tcl
latency-monitor.tcl
lazyfree.tcl
limits.tcl
maxmemory.tcl
memefficiency.tcl
multi.tcl
obuf-limits.tcl
other.tcl
printver.tcl
protocol.tcl
pubsub.tcl
quit.tcl
scan.tcl
scripting.tcl
slowlog.tcl
sort.tcl
instances.tcl
test_helper.tcl
utils
.gitignore
00-RELEASENOTES
BUGS
CONTRIBUTING
COPYING
INSTALL
MANIFESTO
Makefile
README.md
redis.conf
runtest
runtest-cluster
runtest-sentinel
sentinel.conf
redis/tests/unit/quit.tcl

41 lines
986 B
Tcl
Raw Normal View History

2010-10-15 12:54:53 +02:00
start_server {tags {"quit"}} {
proc format_command {args} {
set cmd "*[llength $args]\r\n"
foreach a $args {
append cmd "$[string length $a]\r\n$a\r\n"
}
set _ $cmd
}
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]
}
}