Branch Coverage

blib/lib/Mojo/File.pm
Criterion Covered Total %
branch 62 68 91.1


line true false branch
26 1 3 unless CORE::chmod $mode, $$self
32 0 2 unless copy($$self, $to)
33 1 1 -d $to ? :
45 9 1 $tx ? :
48 87 9 (shift())->basename =~ /.+\.([^.]+)$/u ? :
55 2 29 unless -d $$self
56 0 29 unless opendir my $dir, $$self
57 221 29 if $_ ne "."
58 27 2 unless $options->{'hidden'}
60 27 2 unless $options->{'dir'}
67 9 230 unless -d $$self
72 0 746 unless opendir my $dh, $path
73 3416 746 if $_ ne "."
74 720 26 unless $options->{'hidden'}
78 2156 506 if $options->{'dir'} or not $is_dir
80 516 11 if $is_dir and not -l $$child and !$options->{'max_depth'} || $depth + 1 < $options->{'max_depth'}
98 0 10 unless move($$self, $to)
99 1 9 -d $to ? :
104 2 11174 if grep {not defined $_;} @_
105 6157 183 @_ > 1 ? :
4834 6340 @_ == 1 ? :
112 1 140 unless $handle->open($$self, @_)
122 46 6 if -e $$self
140 1 129 unless CORE::open my $file, "<", $$self
143 0 129 unless defined $ret
145 2 127 $encoding ? :
150 1 56 if $encoding
151 1 56 unless CORE::open my $file, ">", $$self
152 1 54 unless ($file->syswrite($content) // -1) == length $content
176 2 2 unless -e $$self
177 0 4 unless utime undef, undef, $$self
186 16 6 unless my $err = $tx->error
187 3 3 if $err->{'message'} eq "Download complete" or $err->{'message'} eq "Download incomplete"
188 1 2 if $err->{'code'}