Blame t/noreply.t

Packit Service 584ef9
#!/usr/bin/perl
Packit Service 584ef9
Packit Service 584ef9
use strict;
Packit Service 584ef9
use Test::More tests => 9;
Packit Service 584ef9
use FindBin qw($Bin);
Packit Service 584ef9
use lib "$Bin/lib";
Packit Service 584ef9
use MemcachedTest;
Packit Service 584ef9
Packit Service 584ef9
Packit Service 584ef9
my $server = new_memcached();
Packit Service 584ef9
my $sock = $server->sock;
Packit Service 584ef9
Packit Service 584ef9
Packit Service 584ef9
# Test that commands can take 'noreply' parameter.
Packit Service 584ef9
print $sock "flush_all noreply\r\n";
Packit Service 584ef9
print $sock "flush_all 0 noreply\r\n";
Packit Service 584ef9
Packit Service 584ef9
print $sock "verbosity 0 noreply\r\n";
Packit Service 584ef9
Packit Service 584ef9
print $sock "add noreply:foo 0 0 1 noreply\r\n1\r\n";
Packit Service 584ef9
mem_get_is($sock, "noreply:foo", "1");
Packit Service 584ef9
Packit Service 584ef9
print $sock "set noreply:foo 0 0 1 noreply\r\n2\r\n";
Packit Service 584ef9
mem_get_is($sock, "noreply:foo", "2");
Packit Service 584ef9
Packit Service 584ef9
print $sock "replace noreply:foo 0 0 1 noreply\r\n3\r\n";
Packit Service 584ef9
mem_get_is($sock, "noreply:foo", "3");
Packit Service 584ef9
Packit Service 584ef9
print $sock "append noreply:foo 0 0 1 noreply\r\n4\r\n";
Packit Service 584ef9
mem_get_is($sock, "noreply:foo", "34");
Packit Service 584ef9
Packit Service 584ef9
print $sock "prepend noreply:foo 0 0 1 noreply\r\n5\r\n";
Packit Service 584ef9
my @result = mem_gets($sock, "noreply:foo");
Packit Service 584ef9
ok($result[1] eq "534");
Packit Service 584ef9
Packit Service 584ef9
print $sock "cas noreply:foo 0 0 1 $result[0] noreply\r\n6\r\n";
Packit Service 584ef9
mem_get_is($sock, "noreply:foo", "6");
Packit Service 584ef9
Packit Service 584ef9
print $sock "incr noreply:foo 3 noreply\r\n";
Packit Service 584ef9
mem_get_is($sock, "noreply:foo", "9");
Packit Service 584ef9
Packit Service 584ef9
print $sock "decr noreply:foo 2 noreply\r\n";
Packit Service 584ef9
mem_get_is($sock, "noreply:foo", "7");
Packit Service 584ef9
Packit Service 584ef9
print $sock "delete noreply:foo noreply\r\n";
Packit Service 584ef9
mem_get_is($sock, "noreply:foo");