line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CHI::t::Initialize; |
2
|
|
|
|
|
|
|
$CHI::t::Initialize::VERSION = '0.60'; |
3
|
1
|
|
|
1
|
|
436
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
5
|
1
|
|
|
1
|
|
293
|
use CHI::Test; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
6
|
1
|
|
|
1
|
|
5
|
use CHI::Util qw(dump_one_line); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
7
|
1
|
|
|
1
|
|
5
|
use base qw(CHI::Test::Class); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
409
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub is_good { |
10
|
4
|
|
|
4
|
0
|
13
|
my (@params) = @_; |
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
|
|
19
|
my $cache = CHI->new(@params); |
13
|
4
|
|
|
|
|
45
|
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
|
9
|
my (@params) = @_; |
23
|
|
|
|
|
|
|
|
24
|
3
|
|
|
3
|
|
326
|
dies_ok( sub { my $cache = CHI->new(@params) }, |
25
|
3
|
|
|
|
|
20
|
sprintf( "died with params '%s'", dump_one_line( \@params ) ) ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub test_driver_options : Tests { |
29
|
1
|
|
|
1
|
0
|
983
|
my $cache; |
30
|
1
|
|
|
|
|
4
|
is_good( driver => 'Memory', global => 1 ); |
31
|
1
|
|
|
|
|
803
|
is_good( driver => 'File' ); |
32
|
1
|
|
|
|
|
578
|
is_good( driver_class => 'CHI::Driver::Memory', global => 1 ); |
33
|
1
|
|
|
|
|
337
|
is_good( driver_class => 'CHI::Driver::File' ); |
34
|
1
|
|
|
|
|
346
|
is_bad( driver_class => 'Memory' ); |
35
|
1
|
|
|
|
|
579
|
is_bad( driver => 'CHI::Driver::File' ); |
36
|
1
|
|
|
|
|
450
|
is_bad( driver => 'DoesNotExist' ); |
37
|
1
|
|
|
1
|
|
9
|
} |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |