4
use Test::More tests => 10;
9
my $server = new_memcached();
10
my $sock = $server->sock;
13
print $sock "set foo 0 0 6\r\nfooval\r\n";
14
is(scalar <$sock>, "STORED\r\n", "stored foo");
16
mem_get_is($sock, "foo", "fooval");
17
print $sock "flush_all\r\n";
18
is(scalar <$sock>, "OK\r\n", "did flush_all");
19
mem_get_is($sock, "foo", undef);
21
# check that flush_all doesn't blow away items that immediately get set
22
print $sock "set foo 0 0 3\r\nnew\r\n";
23
is(scalar <$sock>, "STORED\r\n", "stored foo = 'new'");
24
mem_get_is($sock, "foo", 'new');
26
# and the other form, specifying a flush_all time...
27
my $expire = time() + 2;
28
print $sock "flush_all $expire\r\n";
29
is(scalar <$sock>, "OK\r\n", "did flush_all in future");
31
print $sock "set foo 0 0 4\r\n1234\r\n";
32
is(scalar <$sock>, "STORED\r\n", "stored foo = '1234'");
33
mem_get_is($sock, "foo", '1234');
35
mem_get_is($sock, "foo", undef);