summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Sallings <dustin@spy.net>2009-03-11 00:18:57 -0700
committerDustin Sallings <dustin@spy.net>2009-03-11 00:18:57 -0700
commit81e41043baabbdb950a3cfd4c500931d5093e62f (patch)
tree2366d3e126665dd77d5d074439780bea8429c420
parent0a77fdfacfd6f3b860b9f30d407f6eb048c51325 (diff)
downloadmemcached-81e41043baabbdb950a3cfd4c500931d5093e62f.tar.gz
Added an add behavior test.
Someone in IRC reported this not working one day. Likely a failure on the client side, but it's good to ensure it for us in a test case.
-rwxr-xr-xt/expirations.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/expirations.t b/t/expirations.t
index 4b8153b..c7db308 100755
--- a/t/expirations.t
+++ b/t/expirations.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-use Test::More tests => 10;
+use Test::More tests => 15;
use FindBin qw($Bin);
use lib "$Bin/lib";
use MemcachedTest;
@@ -52,3 +52,13 @@ print $sock "set boo 0 $expire 6\r\nbooval\r\n";
is(scalar <$sock>, "STORED\r\n", "stored boo");
mem_get_is($sock, "boo", undef, "now expired");
+print $sock "add add 0 1 6\r\naddval\r\n";
+is(scalar <$sock>, "STORED\r\n", "stored add");
+mem_get_is($sock, "add", "addval");
+# second add fails
+print $sock "add add 0 1 7\r\naddval2\r\n";
+is(scalar <$sock>, "NOT_STORED\r\n", "add failure");
+sleep(1.3);
+print $sock "add add 0 1 7\r\naddval3\r\n";
+is(scalar <$sock>, "STORED\r\n", "stored add again");
+mem_get_is($sock, "add", "addval3");