diff options
author | dormando <dormando@rydia.net> | 2011-09-27 12:56:59 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2011-09-27 13:01:49 -0700 |
commit | 648a07f9abe2affb622f03bfddb65271422f7055 (patch) | |
tree | d424efee44709637eaf8e029e64c9d9cab3fbd21 /t/touch.t | |
parent | 62434519d31fd7335164bc3a92f8b60ed5a714c8 (diff) | |
download | memcached-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-x | t/touch.t | 23 |
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"); |