"Fossies" - the Fresh Open Source Software Archive

Member "memcached-1.6.15/t/noreply.t" (21 Feb 2022, 1215 Bytes) of package /linux/www/memcached-1.6.15.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/usr/bin/perl
    2 
    3 use strict;
    4 use Test::More tests => 9;
    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 
   14 # Test that commands can take 'noreply' parameter.
   15 print $sock "flush_all noreply\r\n";
   16 print $sock "flush_all 0 noreply\r\n";
   17 
   18 print $sock "verbosity 0 noreply\r\n";
   19 
   20 print $sock "add noreply:foo 0 0 1 noreply\r\n1\r\n";
   21 mem_get_is($sock, "noreply:foo", "1");
   22 
   23 print $sock "set noreply:foo 0 0 1 noreply\r\n2\r\n";
   24 mem_get_is($sock, "noreply:foo", "2");
   25 
   26 print $sock "replace noreply:foo 0 0 1 noreply\r\n3\r\n";
   27 mem_get_is($sock, "noreply:foo", "3");
   28 
   29 print $sock "append noreply:foo 0 0 1 noreply\r\n4\r\n";
   30 mem_get_is($sock, "noreply:foo", "34");
   31 
   32 print $sock "prepend noreply:foo 0 0 1 noreply\r\n5\r\n";
   33 my @result = mem_gets($sock, "noreply:foo");
   34 ok($result[1] eq "534");
   35 
   36 print $sock "cas noreply:foo 0 0 1 $result[0] noreply\r\n6\r\n";
   37 mem_get_is($sock, "noreply:foo", "6");
   38 
   39 print $sock "incr noreply:foo 3 noreply\r\n";
   40 mem_get_is($sock, "noreply:foo", "9");
   41 
   42 print $sock "decr noreply:foo 2 noreply\r\n";
   43 mem_get_is($sock, "noreply:foo", "7");
   44 
   45 print $sock "delete noreply:foo noreply\r\n";
   46 mem_get_is($sock, "noreply:foo");