File: issue_108.t

package info (click to toggle)
memcached 1.4.21-1.1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 2,308 kB
  • ctags: 1,954
  • sloc: ansic: 10,385; sh: 4,359; perl: 4,054; xml: 1,634; makefile: 148
file content (27 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/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;
my $key = "del_key";

print $sock "add $key 0 0 1\r\nx\r\n";
is (scalar <$sock>, "STORED\r\n", "Added a key");

print $sock "delete $key 0\r\n";
is (scalar <$sock>, "DELETED\r\n", "Properly deleted with 0");

print $sock "add $key 0 0 1\r\nx\r\n";
is (scalar <$sock>, "STORED\r\n", "Added again a key");

print $sock "delete $key 0 noreply\r\n";
# will not reply, but a subsequent add will succeed

print $sock "add $key 0 0 1\r\nx\r\n";
is (scalar <$sock>, "STORED\r\n", "Add succeeded after quiet deletion.");