"Fossies" - the Fresh Open Source Software Archive

Member "memcached-1.6.15/t/issue_140.t" (16 Jul 2020, 974 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;
    5 use FindBin qw($Bin);
    6 use lib "$Bin/lib";
    7 use MemcachedTest;
    8 
    9 plan skip_all => 'Fix for Issue 140 was only an illusion';
   10 
   11 plan tests => 7;
   12 
   13 my $server = new_memcached();
   14 my $sock = $server->sock;
   15 
   16 print $sock "set a 0 0 1\r\na\r\n";
   17 is (scalar <$sock>, "STORED\r\n", "stored key");
   18 
   19 my $stats  = mem_stats($sock, "items");
   20 my $age = $stats->{"items:1:age"};
   21 isnt ($age, "0", "Age should not be zero");
   22 
   23 print $sock "flush_all\r\n";
   24 is (scalar <$sock>, "OK\r\n", "items flushed");
   25 
   26 my $stats  = mem_stats($sock, "items");
   27 my $age = $stats->{"items:1:age"};
   28 is ($age, undef, "all should be gone");
   29 
   30 print $sock "set a 0 1 1\r\na\r\n";
   31 is (scalar <$sock>, "STORED\r\n", "stored key");
   32 
   33 my $stats  = mem_stats($sock, "items");
   34 my $age = $stats->{"items:1:age"};
   35 isnt ($age, "0", "Age should not be zero");
   36 
   37 sleep(3);
   38 
   39 my $stats  = mem_stats($sock, "items");
   40 my $age = $stats->{"items:1:age"};
   41 is ($age, undef, "all should be gone");