~brianaker/libmemcached/1164440

« back to all changes in this revision

Viewing changes to memcached/t/touch.t

  • Committer: Continuous Integration
  • Date: 2012-04-03 18:18:34 UTC
  • mfrom: (991.2.3 workspace)
  • Revision ID: ci@tangent.org-20120403181834-3rhqwta504fs9urv
jenkins-promote-staging-trunk-libmemcached-4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
use strict;
 
4
use Test::More tests => 4;
 
5
use FindBin qw($Bin);
 
6
use lib "$Bin/lib";
 
7
use MemcachedTest;
 
8
 
 
9
 
 
10
my $server = new_memcached();
 
11
my $sock = $server->sock;
 
12
 
 
13
# set foo (and should get it)
 
14
print $sock "set foo 0 2 6\r\nfooval\r\n";
 
15
is(scalar <$sock>, "STORED\r\n", "stored foo");
 
16
mem_get_is($sock, "foo", "fooval");
 
17
 
 
18
# touch it
 
19
print $sock "touch foo 10\r\n";
 
20
is(scalar <$sock>, "TOUCHED\r\n", "touched foo");
 
21
 
 
22
sleep 2;
 
23
mem_get_is($sock, "foo", "fooval");