File: 06_flush.t

package info (click to toggle)
libcache-memcached-libmemcached-perl 0.04001-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 340 kB
  • sloc: perl: 2,274; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 529 bytes parent folder | download | duplicates (3)
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
28
use strict;
use lib 't/lib';
use libmemcached_test;
use Test::More;

my $cache = libmemcached_test_create();
plan(tests => 7);

isa_ok($cache, "Cache::Memcached::libmemcached");

my @keys = ('a' .. 'z');
foreach my $key (@keys) {
    $cache->set($key, $key);
}

my $h = $cache->get_multi(@keys);
ok($h);
isa_ok($h, 'HASH');

my %expected = map { ($_ => $_) } @keys;
is_deeply( $h, \%expected, "got all the expected values");

$cache->flush_all;
$h = $cache->get_multi(@keys);
ok($h);
isa_ok($h, 'HASH');

is(scalar keys %$h, 0);