Branch Coverage

blib/lib/File/CacheDir.pm
Criterion Covered Total %
branch 57 114 50.0


line true false branch
23 11 1 ref $hash_ref eq 'HASH' ? :
47 12 0 unless ($$cache_object{'set_cookie'})
53 0 12 unless $$cache_object{$_}
63 0 4 unless $self->dash_d($_ttl_dir)
70 8 0 if ($diff > $$self{'periods_to_keep'}) { }
83 18 34 if ($$self{'cache_stats'} and $File::CacheDir::EXTANT_DIR{$_dir}) { }
86 18 16 if (-d $_dir)
106 12 0 unless -d $File::CacheDir::EXTANT_DIR{$this_dir}
110 0 8 if rand 100 >= $$self{'cleanup_frequency'}
116 0 8 if (@stat and time - $stat[9] < $$self{'cleanup_length'})
125 0 8 unless flock FILE, 6
127 4 4 if ($$self{'cleanup_fork'})
128 4 0 if strong_fork()
133 0 4 if $$self{'cleanup_fork'}
139 0 14 if $root =~ /$$self{'cleanup_suffix'}$/
140 4 10 if -l $root or not -d _
142 10 0 if (my $dir = 'IO::Dir'->new($root))
144 20 8 if $node =~ /^\.\.?$/
145 8 0 if $node =~ /(.+)/
155 0 12 if ($$self{'ttl'} =~ /^\d+$/) { }
12 0 elsif ($$self{'ttl'} =~ s/^(\d+)\s*(\D+)$/$1/) { }
158 12 0 if defined $1
159 12 0 defined $2 ? :
160 10 2 if ($units =~ /^s/i or not $units) { }
0 2 elsif ($units =~ /^m/i) { }
2 0 elsif ($units =~ /^h/i) { }
0 0 elsif ($units =~ /^d/i) { }
0 0 elsif ($units =~ /^w/i) { }
182 0 12 unless $self->dash_d($_dir)
187 2 10 unless (UNIVERSAL::isa($self, 'File::CacheDir'))
198 4 8 unless ($self->dash_d($ttl_dir))
207 12 0 if ($$self{'carry_forward'})
211 4 8 if (-e $$self{'carry_forward_filename'})
212 4 0 unless ($self->dash_d($$self{'full_dir'}))
214 0 4 unless $self->dash_d($$self{'full_dir'})
220 0 4 unless -e $$self{'full_path'}
224 0 4 if ($$self{'set_cookie'})
233 0 8 if ($self->dash_d($$self{'full_dir'})) { }
235 0 0 if ($$self{'set_cookie'})
241 8 0 if (rand 100 < $$self{'cleanup_frequency'})
244 16 8 if $sub_dir =~ /^\.\.?$/
245 0 8 if $sub_dir =~ /$$self{'cleanup_suffix'}/
246 8 0 if $sub_dir =~ /(.+)/
247 8 0 if ($self->expired_check($sub_dir))
254 0 8 unless $self->dash_d($$self{'full_dir'})
256 0 8 if ($$self{'set_cookie'})
266 0 0 unless $$self{'set_cookie'}
268 0 0 if (not $$self{'cookie_brick_over'} and defined $old_cookie)
278 0 0 if ($$self{'content_typed'}) { }
303 0 4 unless (defined $child)
307 4 0 if ($child)
317 0 4 unless (defined $grandchild_pid)
342 0 0 if (not defined $grandchild_pid) { }
0 0 elsif ($grandchild_pid) { }
372 0 0 if tied *STDOUT
382 0 0 unless ($routine and ref $routine)
398 0 0 if ($@)