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