line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CHI::t::Driver::File::DepthZero; |
2
|
|
|
|
|
|
|
$CHI::t::Driver::File::DepthZero::VERSION = '0.59'; |
3
|
1
|
|
|
1
|
|
454
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
63
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
5
|
1
|
|
|
1
|
|
321
|
use CHI::Test; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use File::Temp qw(tempdir); |
7
|
|
|
|
|
|
|
use File::Basename qw(dirname); |
8
|
|
|
|
|
|
|
use base qw(CHI::t::Driver::File); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# Test file driver with zero depth |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub testing_driver_class { 'CHI::Driver::File' } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new_cache_options { |
15
|
|
|
|
|
|
|
my $self = shift; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
return ( $self->SUPER::new_cache_options(), depth => 0 ); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub test_default_depth : Tests { |
21
|
|
|
|
|
|
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $cache = $self->new_cache(); |
24
|
|
|
|
|
|
|
is( $cache->depth, 0 ); |
25
|
|
|
|
|
|
|
is( dirname( $cache->path_to_key('foo') ), |
26
|
|
|
|
|
|
|
$cache->path_to_namespace, "data files are one level below namespace" ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |