Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
5a4f9f27
Commit
5a4f9f27
authored
Oct 15, 2010
by
Pieter Noordhuis
Browse files
Add tests for OK on QUIT
parent
941c9fa2
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/test_helper.tcl
View file @
5a4f9f27
...
...
@@ -115,6 +115,7 @@ proc execute_everything {} {
execute_tests
"unit/expire"
execute_tests
"unit/other"
execute_tests
"unit/cas"
execute_tests
"unit/quit"
execute_tests
"integration/replication"
execute_tests
"integration/aof"
# execute_tests
"integration/redis-cli"
...
...
tests/unit/quit.tcl
0 → 100644
View file @
5a4f9f27
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
]
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment