summaryrefslogtreecommitdiff
path: root/t/touch.t
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2011-09-27 12:56:59 -0700
committerdormando <dormando@rydia.net>2011-09-27 13:01:49 -0700
commit648a07f9abe2affb622f03bfddb65271422f7055 (patch)
treed424efee44709637eaf8e029e64c9d9cab3fbd21 /t/touch.t
parent62434519d31fd7335164bc3a92f8b60ed5a714c8 (diff)
downloadmemcached-648a07f9abe2affb622f03bfddb65271422f7055.tar.gz
Add an ASCII touch command.
Not doing GAT for now since I'd have to iterate through gat/gats/multigat/etc. If there's demand, we can add it.
Diffstat (limited to 't/touch.t')
-rwxr-xr-xt/touch.t23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/touch.t b/t/touch.t
new file mode 100755
index 0000000..dd2eba1
--- /dev/null
+++ b/t/touch.t
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+
+use strict;
+use Test::More tests => 4;
+use FindBin qw($Bin);
+use lib "$Bin/lib";
+use MemcachedTest;
+
+
+my $server = new_memcached();
+my $sock = $server->sock;
+
+# set foo (and should get it)
+print $sock "set foo 0 2 6\r\nfooval\r\n";
+is(scalar <$sock>, "STORED\r\n", "stored foo");
+mem_get_is($sock, "foo", "fooval");
+
+# touch it
+print $sock "touch foo 10\r\n";
+is(scalar <$sock>, "TOUCHED\r\n", "touched foo");
+
+sleep 2;
+mem_get_is($sock, "foo", "fooval");