Branch Coverage

blib/lib/Pcore/Util/File.pm
Criterion Covered Total %
branch 35 248 14.1


line true false branch
19 0 0 if (defined wantarray) { }
0 0 elsif (CORE::chdir $path) { }
22 0 0 unless CORE::chdir $path
38 0 0 if $Pcore::Util::File::MSWIN
40 0 0 if (defined wantarray) { }
51 0 0 unless defined $mode
58 0 0 if ($mode =~ /[^[:digit:]]/imsu) { }
61 0 0 unless (exists $mode_cache->{$mode})
67 0 0 if defined $mode[0] and $mode[0] eq 'r'
68 0 0 if defined $mode[1] and $mode[1] eq 'w'
69 0 0 if defined $mode[2] and $mode[2] eq 'x'
72 0 0 if defined $mode[3] and $mode[3] eq 'r'
73 0 0 if defined $mode[4] and $mode[4] eq 'w'
74 0 0 if defined $mode[5] and $mode[5] eq 'x'
77 0 0 if defined $mode[6] and $mode[6] eq 'r'
78 0 0 if defined $mode[7] and $mode[7] eq 'w'
79 0 0 if defined $mode[8] and $mode[8] eq 'x'
87 0 0 if substr($mode, 0, 1) eq '0'
90 0 0 $args{'oct'} ? :
95 0 0 if (defined wantarray) { }
96 0 0 if (defined $mode) { }
104 0 0 if (defined $mode) { }
105 0 0 unless CORE::mkdir $path, calc_chmod($mode)
108 0 0 unless CORE::mkdir $path
116 0 0 if (defined wantarray) { }
125 0 10 unless defined $mode
132 10 0 if ($mode =~ /[^[:digit:]]/imsu) { }
135 5 5 unless (exists $mode_cache->{$mode})
141 5 0 if defined $mode[0] and $mode[0] eq 'r'
142 5 0 if defined $mode[1] and $mode[1] eq 'w'
143 0 5 if defined $mode[2] and $mode[2] eq 'x'
146 0 5 if defined $mode[3] and $mode[3] eq 'r'
147 0 5 if defined $mode[4] and $mode[4] eq 'w'
148 0 5 if defined $mode[5] and $mode[5] eq 'x'
151 0 5 if defined $mode[6] and $mode[6] eq 'r'
152 0 5 if defined $mode[7] and $mode[7] eq 'w'
153 0 5 if defined $mode[8] and $mode[8] eq 'x'
161 0 0 if substr($mode, 0, 1) eq '0'
164 0 10 $args{'oct'} ? :
182 0 16 unless defined $bytes
184 0 16 if ($args{'cb'}) { }
185 0 0 if ($bytes) { }
186 0 0 unless $args{'cb'}(\$buf)
197 8 8 if ($bytes) { }
224 0 4 unless defined $bytes
226 0 4 if ($args{'cb'}) { }
227 0 0 if ($bytes) { }
228 0 0 unless $args{'cb'}(\$buf)
239 2 2 if ($bytes) { }
267 0 0 unless defined $bytes
269 0 0 if ($args{'cb'}) { }
270 0 0 if ($bytes) { }
271 0 0 if (index($buf, "\n") == -1) { }
277 0 0 if ($args{'empty_lines'}) { }
282 0 0 unless $args{'cb'}($array_ref)
288 0 0 if defined $array_ref->[0] and $array_ref->[0] eq ''
290 0 0 if (substr($buf, -1, 1) ne "\n") { }
297 0 0 if (@$array_ref)
298 0 0 unless $args{'cb'}($array_ref)
306 0 0 if ($tail ne '')
307 0 0 unless $args{'cb'}([$tail])
316 0 0 if ($bytes) { }
322 0 0 if ($args{'empty_lines'}) { }
326 0 0 if defined $array_ref->[-1] and $array_ref->[-1] eq ''
334 0 0 if defined $array_ref->[0] and $array_ref->[0] eq ''
348 0 0 XXX ? :
362 0 0 XXX ? :
378 0 0 XXX ? :
394 0 0 XXX ? :
403 0 10 if ($Pcore::Util::File::MSWIN)
406 0 0 if utf8::is_utf8($path)
422 0 10 if (&is_glob($path)) { }
428 0 10 if defined $args{'umask'}
433 0 10 unless sysopen my $fh, $path, $mode, calc_chmod($args{'mode'})
437 0 0 $Pcore::Util::File::MSWIN ? :
439 2 8 if ($args{'crlf'}) { }
440 2 0 unless $Pcore::Util::File::MSWIN
443 0 8 if $Pcore::Util::File::MSWIN
446 2 8 if $args{'binmode'}
448 2 8 if $binmode
450 10 0 if $args{'autoflush'}
460 0 0 if (XXX) { }
0 0 elsif (ref $str eq 'SCALAR') { }
484 0 0 unless opendir my $dh, $path
488 0 0 if ($args{'keep_dot'}) { }
492 0 0 if $_ ne '.'
495 0 0 if ($args{'full_path'})
501 0 0 unless closedir $dh
518 0 0 unless (-e $path)
521 0 0 defined $args{'umask'} ? :
523 0 0 unless sysopen my $FH, $path, 1089, calc_chmod($args{'mode'})
525 0 0 unless close $FH
531 0 0 unless utime $args{'atime'}, $args{'mtime'}, $path
548 0 0 defined $args{'umask'} ? :
568 0 0 @$error ? :
604 0 0 if defined $args{'suffix'} and $args{'suffix'} ne '' and substr($args{'suffix'}, 0, 1) ne '.'
608 0 0 unless -e $args{'base'}
612 0 0 unless $attempt--
617 0 0 if -e $args{'base'} . '/' . $filename
637 0 0 defined $args{'umask'} ? :
648 0 0 if (-d $from) { }
0 0 elsif (-f $from) { }
649 0 0 if ($args{'glob'}) { }
679 0 0 defined $args{'umask'} ? :
690 0 0 if (-d $from) { }
0 0 elsif (-f $from) { }
691 0 0 if ($args{'glob'}) { }
717 0 0 unless $path = 'Pcore'->path($path, 'is_dir', 1)->realpath
723 0 0 unless $args{'abs'}
731 0 0 if (-d $file) { }
734 0 0 if $args{'dir'}
741 0 0 if $args{'file'}
748 0 0 $args{'abs'} ? :
761 0 0 if ($env_path ne $ENV{'PATH'})
771 0 0 if ($Pcore::Util::File::MSWIN and $ENV{'PATHEXT'} and $env_pathext ne $ENV{'PATHEXT'})
781 0 0 if (-e "$path/$filename$ext")
782 0 0 if ($wantarray) { }
811 0 0 unless $file->is_file
815 0 0 if ($args{'strip_component'})
816 0 0 unless ($strip_component)
819 0 0 if @labels < $args{'strip_component'}
824 0 0 unless $path =~ s/\A$strip_component//msu
829 0 0 unless -e $target_path->dirname
831 0 0 if ($file->extract($target_path)) { }