line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CHI::t::Initialize; |
2
|
|
|
|
|
|
|
$CHI::t::Initialize::VERSION = '0.61'; |
3
|
1
|
|
|
1
|
|
426
|
use strict; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
5
|
1
|
|
|
1
|
|
393
|
use CHI::Test; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
7
|
use CHI::Util qw(dump_one_line); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
7
|
1
|
|
|
1
|
|
6
|
use base qw(CHI::Test::Class); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1738
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub is_good { |
10
|
4
|
|
|
4
|
0
|
17
|
my (@params) = @_; |
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
|
|
17
|
my $cache = CHI->new(@params); |
13
|
4
|
|
|
|
|
20
|
isa_ok( |
14
|
|
|
|
|
|
|
$cache, |
15
|
|
|
|
|
|
|
'CHI::Driver', |
16
|
|
|
|
|
|
|
sprintf( "got a good cache with params '%s'", |
17
|
|
|
|
|
|
|
dump_one_line( \@params ) ) |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub is_bad { |
22
|
3
|
|
|
3
|
0
|
10
|
my (@params) = @_; |
23
|
|
|
|
|
|
|
|
24
|
3
|
|
|
3
|
|
286
|
dies_ok( sub { my $cache = CHI->new(@params) }, |
25
|
3
|
|
|
|
|
19
|
sprintf( "died with params '%s'", dump_one_line( \@params ) ) ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub test_driver_options : Tests { |
29
|
1
|
|
|
1
|
0
|
1388
|
my $cache; |
30
|
1
|
|
|
|
|
4
|
is_good( driver => 'Memory', global => 1 ); |
31
|
1
|
|
|
|
|
787
|
is_good( driver => 'File' ); |
32
|
1
|
|
|
|
|
682
|
is_good( driver_class => 'CHI::Driver::Memory', global => 1 ); |
33
|
1
|
|
|
|
|
487
|
is_good( driver_class => 'CHI::Driver::File' ); |
34
|
1
|
|
|
|
|
461
|
is_bad( driver_class => 'Memory' ); |
35
|
1
|
|
|
|
|
735
|
is_bad( driver => 'CHI::Driver::File' ); |
36
|
1
|
|
|
|
|
528
|
is_bad( driver => 'DoesNotExist' ); |
37
|
1
|
|
|
1
|
|
9
|
} |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
4
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |