From 5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Wed, 21 Jan 2026 22:40:55 +0100 Subject: Add Redis source code for testing --- examples/redis-unstable/tests/unit/quit.tcl | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 examples/redis-unstable/tests/unit/quit.tcl (limited to 'examples/redis-unstable/tests/unit/quit.tcl') diff --git a/examples/redis-unstable/tests/unit/quit.tcl b/examples/redis-unstable/tests/unit/quit.tcl new file mode 100644 index 0000000..50ccab1 --- /dev/null +++ b/examples/redis-unstable/tests/unit/quit.tcl @@ -0,0 +1,33 @@ +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] + + } +} -- cgit v1.2.3