/usr/share/perl5/CHI/Driver/Memcached/Test/Driver.pm is in libchi-driver-memcached-perl 0.15-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | package CHI::Driver::Memcached::Test::Driver;
$CHI::Driver::Memcached::Test::Driver::VERSION = '0.15';
use strict;
use warnings;
use Moose;
use CHI::t::Driver;
use CHI::Driver::Memcached::t::CHIDriverTests;
use base qw(CHI::Driver::Memcached);
__PACKAGE__->meta->make_immutable;
# Reverse declare_unsupported_methods
#
foreach my $method (qw(dump_as_hash is_empty purge)) {
no strict 'refs';
*{ __PACKAGE__ . "::$method" } = sub {
my $self = shift;
my $full_method = "CHI::Driver::$method";
return $self->$full_method(@_);
};
}
sub all_test_keys {
my ($standard_keys) =
CHI::Driver::Memcached::t::CHIDriverTests->set_standard_keys_and_values();
my $all_test_keys = [
values(%$standard_keys),
CHI::Driver::Memcached::t::CHIDriverTests->extra_test_keys()
];
return $all_test_keys;
}
# Memcached doesn't support get_keys. For testing purposes, define get_keys
# and clear by checking for all keys used during testing. Note, some keys
# are changed in CHIDriverTests::set_standard_keys_and_values.
#
sub get_keys {
my $self = shift;
my $all_test_keys = $self->all_test_keys;
my $values = $self->get_multi_hashref($all_test_keys);
my @defined_keys = grep { defined $values->{$_} } keys(%$values);
return @defined_keys;
}
sub clear {
my $self = shift;
my $all_test_keys = $self->all_test_keys;
foreach my $key (@$all_test_keys) {
$self->remove($key);
}
}
1;
|