Skip to content

Commit

Permalink
Test cachedump on text protocol.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin committed Feb 13, 2009
1 parent bd2f3ab commit 74e80c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions t/lib/MemcachedTest.pm
Expand Up @@ -26,9 +26,9 @@ sub mem_stats {
my $stats = {};
while (<$sock>) {
last if /^(\.|END)/;
/^STAT (\S+) (\d+)/;
/^(STAT|ITEM) (\S+)\s+([^\r\n]+)/;
#print " slabs: $_";
$stats->{$1} = $2;
$stats->{$2} = $3;
}
return $stats;
}
Expand Down
6 changes: 5 additions & 1 deletion t/stats.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl

use strict;
use Test::More tests => 17;
use Test::More tests => 18;
use FindBin qw($Bin);
use lib "$Bin/lib";
use MemcachedTest;
Expand Down Expand Up @@ -55,3 +55,7 @@ my $stats = mem_stats($sock);
foreach my $key (qw(total_items curr_items cmd_get cmd_set get_hits)) {
is($stats->{$key}, 1, "after one set/one get $key is 1");
}

my $cache_dump = mem_stats($sock, " cachedump 1 100");
ok(defined $cache_dump->{'foo'}, "got foo from cachedump");

0 comments on commit 74e80c7

Please sign in to comment.