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 227 unless -d $$self
72 0 740 unless opendir my $dh, $path
73 3397 740 if $_ ne "."
74 714 26 unless $options->{'hidden'}
78 2145 504 if $options->{'dir'} or not $is_dir
79 513 11 if $is_dir and !$options->{'max_depth'} || $depth + 1 < $options->{'max_depth'}
97 0 10 unless move($$self, $to)
98 1 9 -d $to ? :
103 2 11155 if grep {not defined $_;} @_
104 6139 183 @_ > 1 ? :
4833 6322 @_ == 1 ? :
111 1 140 unless $handle->open($$self, @_)
121 46 6 if -e $$self
139 1 129 unless CORE::open my $file, "<", $$self
142 0 129 unless defined $ret
144 2 127 $encoding ? :
149 1 54 if $encoding
150 1 54 unless CORE::open my $file, ">", $$self
151 1 52 unless ($file->syswrite($content) // -1) == length $content
175 2 2 unless -e $$self
176 0 4 unless utime undef, undef, $$self
185 16 6 unless my $err = $tx->error
186 3 3 if $err->{'message'} eq "Download complete" or $err->{'message'} eq "Download incomplete"
187 1 2 if $err->{'code'}