Branch Coverage

blib/lib/Dir/Write/Rotate.pm
Criterion Covered Total %
branch 50 66 75.7


line true false branch
15 7 1 if (defined(my $v = delete $args{'path'})) { }
20 1 6 if (defined(my $v = delete $args{'filename_pattern'})) { }
25 3 4 if (defined(my $v = delete $args{'filename_sub'}))
28 1 6 if (defined(my $v = delete $args{'max_size'}))
31 1 6 if (defined(my $v = delete $args{'max_files'}))
34 1 6 if (defined(my $v = delete $args{'max_age'}))
37 3 4 if (defined(my $v = delete $args{'rotate_probability'})) { }
42 1 6 if (keys %args)
53 12 9 if ($self->{'filename_sub'})
77 2 5 unless (defined $libmagic)
78 0 2 if (eval { do { require File::LibMagic; require Media::Type::Simple; 1 } }) { }
85 7 0 unless $libmagic
87 0 0 unless $type
90 0 0 if $ext
98 7 49 ref $vars{$1} eq 'CODE' ? :
56 0 defined $vars{$1} ? :
112 12 21 if (-e $filename)
118 0 21 unless sysopen $fh, $filename, 193
122 0 21 unless print $fh $content
123 0 21 unless close $fh
124 15 6 if rand() < $self->{'rotate_probability'}
134 0 10 unless defined $ms or defined $mf or defined $ma
139 0 15 unless opendir my $dh, $path
142 30 44 if $e eq '.' or $e eq '..'
151 0 3 unless $Dir::Write::Rotate::a->{'age'} <=> $Dir::Write::Rotate::b->{'age'}
154 2 13 if (defined $mf and @entries > $mf)
157 0 2 unless unlink $fpath
162 5 10 if (defined $ma)
165 1 11 if ($_->{'age'} > $ma)
168 0 4 unless unlink $fpath
177 5 10 if (defined $ms)
182 1 14 if ($tot_size > $ms)
185 0 1 unless unlink $fpath