line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CHI::Driver::Redis::t::CHIDriverTests; |
2
|
1
|
|
|
1
|
|
708
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
752
|
use CHI::Test; |
|
1
|
|
|
|
|
483648
|
|
|
1
|
|
|
|
|
7
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
40504
|
use base qw(CHI::t::Driver); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1151
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
119180
|
use Test::Mock::Redis; |
|
1
|
|
|
|
|
123117
|
|
|
1
|
|
|
|
|
26
|
|
9
|
|
|
|
|
|
|
|
10
|
148
|
|
|
148
|
0
|
42308
|
sub testing_driver_class { 'CHI::Driver::Redis' } |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
0
|
181
|
sub supports_expires_on_backend { 1 } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new_cache_options { |
15
|
144
|
|
|
144
|
0
|
39971
|
my $self = shift; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
return ( |
18
|
|
|
|
|
|
|
$self->SUPER::new_cache_options(), |
19
|
|
|
|
|
|
|
driver_class => 'CHI::Driver::Redis', |
20
|
|
|
|
|
|
|
redis_class => (defined $ENV{CHI_REDIS_SERVER} ? 'Redis' : 'Test::Mock::Redis'), |
21
|
|
|
|
|
|
|
server => $ENV{CHI_REDIS_SERVER} || undef, |
22
|
144
|
50
|
50
|
|
|
507
|
($ENV{CHI_REDIS_PASSWORD} ? ( password => $ENV{CHI_REDIS_PASSWORD} ) : ()), |
|
|
50
|
|
|
|
|
|
23
|
|
|
|
|
|
|
prefix => 'test' . $$ . ':', |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub clear_redis : Test(setup) { |
28
|
51
|
|
|
51
|
0
|
117501
|
my ($self) = @_; |
29
|
|
|
|
|
|
|
|
30
|
51
|
|
|
|
|
208
|
my $cache = $self->new_cache; |
31
|
51
|
|
|
|
|
1778
|
$cache->redis->flushall; |
32
|
1
|
|
|
1
|
|
228
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub test_redis_object : Tests(1) { |
35
|
1
|
|
|
1
|
0
|
252
|
my $self = shift; |
36
|
1
|
|
|
|
|
6
|
my $cache = $self->new_cache(redis => Test::Mock::Redis->new()); |
37
|
1
|
|
|
|
|
21
|
$cache->clear(); |
38
|
1
|
|
|
1
|
|
546
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub test_redis_options : Tests(1) { |
41
|
1
|
|
|
1
|
0
|
236
|
my $self = shift; |
42
|
1
|
|
|
|
|
7
|
my $cache = $self->new_cache(redis_options => { reconnect => 2 }); |
43
|
1
|
|
|
|
|
21
|
$cache->clear(); |
44
|
1
|
|
|
1
|
|
311
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub test_extra_options : Tests(1) { |
47
|
1
|
|
|
1
|
0
|
175
|
my $self = shift; |
48
|
1
|
|
|
|
|
5
|
my $cache = $self->new_cache(reconnect => 2); |
49
|
1
|
|
|
|
|
16
|
$cache->clear(); |
50
|
1
|
|
|
1
|
|
482
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |