diff options
author | dormando <dormando@rydia.net> | 2013-12-19 23:52:54 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2013-12-19 23:52:54 -0800 |
commit | 8d5c5d0c6a2b63054e46d75ccefb7318557ddd0c (patch) | |
tree | 6c63171d99c81beacf1645579a5dfe4c0cea6b1b | |
parent | a2f5ca50a28cb2348ec39ee2b3c202b57ffc94f3 (diff) | |
download | memcached-8d5c5d0c6a2b63054e46d75ccefb7318557ddd0c.tar.gz |
add tests for -F option
-rwxr-xr-x | t/flush-all.t | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/t/flush-all.t b/t/flush-all.t index b803bb7..4f14389 100755 --- a/t/flush-all.t +++ b/t/flush-all.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use strict; -use Test::More tests => 21; +use Test::More tests => 25; use FindBin qw($Bin); use lib "$Bin/lib"; use MemcachedTest; @@ -54,3 +54,16 @@ print $sock "set foo2 0 0 5\r\n54321\r\n"; is(scalar <$sock>, "STORED\r\n", "stored foo2 = '54321'"); mem_get_is($sock, "foo", '12345'); mem_get_is($sock, "foo2", '54321'); + +# Test -F option which disables flush_all +$server = new_memcached('-F'); +$sock = $server->sock; + +print $sock "set foo 0 0 7\r\nfooval2\r\n"; +is(scalar <$sock>, "STORED\r\n", "stored foo"); + +mem_get_is($sock, "foo", "fooval2"); +print $sock "flush_all\r\n"; +is(scalar <$sock>, "CLIENT_ERROR flush_all not allowed\r\n", "flush_all was not allowed"); +mem_get_is($sock, "foo", "fooval2"); + |