Branch Coverage

inc/File/Temp.pm
Criterion Covered Total %
branch 5 324 1.5


line true false branch
332 0 0 unless scalar @_ >= 1
352 0 0 if (ref $template)
359 0 0 if (scalar(@_) % 2 != 0)
366 0 0 if @_
372 0 0 if ($options{'open'} and $options{'mkdir'})
387 0 0 if (substr($template, $start - 4 + 1, 4) ne 'XXXX')
409 0 0 if ($options{'mkdir'}) { }
419 0 0 if ($#dirs == 0) { }
423 0 0 if ($^O eq 'VMS') { }
425 0 0 if $parent eq ''
446 0 0 unless $directories ne ''
456 0 0 unless (-e $parent)
460 0 0 unless (-d $parent)
464 0 0 unless (-w $parent)
474 0 0 if ('File::Temp'->safe_level == 1) { }
0 0 elsif ('File::Temp'->safe_level == 2) { }
476 0 0 unless (_is_safe($parent, \$safeerr))
482 0 0 unless (_is_verysafe($parent, \$safeerr))
493 0 0 if ($options{'open'}) { }
0 0 elsif ($options{'mkdir'}) { }
497 0 0 if ($] < 5.006)
508 0 0 if ($^O eq 'VMS' and ($options{'unlink_on_close'} and not $File::Temp::KEEP_ALL)) { }
513 0 0 $options{'unlink_on_close'} && !$File::Temp::KEEP_ALL ? :
516 0 0 if defined $LOCKFLAG and $options{'use_exlock'}
519 0 0 if ($open_success) { }
531 0 0 unless ($!{'EEXIST'})
542 0 0 if (mkdir $path, 448) { }
551 0 0 unless ($!{'EEXIST'})
565 0 0 unless -e $path
596 0 0 if ($counter > $MAX_GUESS)
622 0 0 unless scalar @_ == 2
631 0 0 $] >= 5.006 ? :
633 0 0 if ($ignore) { }
676 0 0 unless (scalar @info)
680 0 0 if $^O eq 'VMS'
685 0 0 if ($info[4] > 'File::Temp'->top_system_uid and $info[4] != $>)
690 0 0 if ref $err_ref
700 0 0 if ($info[2] & &Fcntl::S_IWGRP or $info[2] & &Fcntl::S_IWOTH)
703 0 0 unless (-d $path)
704 0 0 if ref $err_ref
709 0 0 unless (-k $path)
710 0 0 if ref $err_ref
735 0 0 if $File::Temp::DEBUG
736 0 0 if $^O eq 'VMS'
745 0 0 if eval { do { &POSIX::_PC_CHOWN_RESTRICTED(); 1 } }
748 0 0 if (defined $chown_restricted)
751 0 0 if POSIX::sysconf($chown_restricted)
761 0 0 unless ('File::Spec'->file_name_is_absolute($path))
783 0 0 if $File::Temp::DEBUG
786 0 0 unless _is_safe($dir, $err_ref)
806 0 0 if ($^O eq 'MSWin32' or $^O eq 'os2' or $^O eq 'VMS' or $^O eq 'dos' or $^O eq 'MacOS') { }
827 0 0 if $level == 0
830 0 0 if ($^O eq 'MSWin32' or $^O eq 'os2' or $^O eq 'cygwin' or $^O eq 'dos' or $^O eq 'MacOS' or $^O eq 'mpeix') { }
879 2 0 if (not $File::Temp::KEEP_ALL)
882 0 2 exists $files_to_unlink{$$} ? :
890 0 0 if (-f $$file[1])
892 0 0 unless unlink $$file[1]
897 0 2 exists $dirs_to_unlink{$$} ? :
899 0 0 if (-d $dir)
905 0 2 if exists $files_to_unlink{$$}
907 0 2 if exists $dirs_to_unlink{$$}
920 0 0 unless scalar @_ == 3
925 0 0 if $File::Temp::DEBUG
929 0 0 if ($isdir) { }
931 0 0 if (-d $fname) { }
935 0 0 if $^O eq 'VMS'
936 0 0 unless exists $dirs_to_unlink{$$}
941 0 0 if $^W
946 0 0 if (-f $fname) { }
949 0 0 unless exists $files_to_unlink{$$}
954 0 0 if $^W
1015 0 0 exists $args{'UNLINK'} ? :
1020 0 0 exists $args{'TEMPLATE'} ? :
1029 0 0 if $File::Temp::DEBUG
1069 0 0 scalar(@_) % 2 == 1 ? :
1071 0 0 exists $options{'CLEANUP'} ? :
1076 0 0 if (defined $template) { }
1131 0 0 if (@_)
1160 0 0 if (${*$self;}{'UNLINK'} and not $File::Temp::KEEP_ALL)
1161 0 0 if $File::Temp::DEBUG
1164 0 0 unless exists $FILES_CREATED_BY_OBJECT{$$}{$self->filename}
1173 0 0 unless unlink1($self, $self->filename)
1296 0 0 scalar(@_) % 2 == 1 ? :
1299 0 0 if @_
1302 0 0 unless ($options{'OPEN'})
1304 0 0 if $^W
1309 0 0 if ($options{'DIR'} and $^O eq 'VMS')
1323 0 0 if (defined $template) { }
1325 0 0 if ($options{'DIR'}) { }
0 0 elsif ($options{'TMPDIR'}) { }
1337 0 0 if ($options{'DIR'}) { }
1362 0 0 wantarray ? :
1366 0 0 unless ($fh, $path) = _gettemp($template, 'open', $options{'OPEN'}, 'mkdir', 0, 'unlink_on_close', $unlink_on_close, 'suffixlen', length $options{'SUFFIX'}, 'ErrStr', \$errstr, 'use_exlock', $options{'EXLOCK'})
1382 0 0 if $options{'UNLINK'}
1385 0 0 if (wantarray) { }
1387 0 0 if ($options{'OPEN'}) { }
1397 0 0 unless unlink0($fh, $path)
1484 0 0 scalar(@_) % 2 == 1 ? :
1487 0 0 if @_
1492 0 0 if (defined $template) { }
1495 0 0 if ($options{'TMPDIR'} or $options{'DIR'})
1500 0 0 if $^O eq 'VMS'
1507 0 0 if ($options{'DIR'}) { }
0 0 elsif ($options{'TMPDIR'}) { }
1522 0 0 if ($options{'DIR'}) { }
1537 0 0 if ($^O eq 'VMS')
1541 0 0 if ($^O eq 'MacOS' and substr($template, -1) eq ':')
1547 0 0 unless (undef, $tempdir) = _gettemp($template, 'open', 0, 'mkdir', 1, 'suffixlen', $suffixlen, 'ErrStr', \$errstr)
1556 0 0 if ($options{'CLEANUP'} and -d $tempdir)
1595 0 0 if scalar @_ != 1
1601 0 0 unless ($fh, $path) = _gettemp($template, 'open', 1, 'mkdir', 0, 'suffixlen', 0, 'ErrStr', \$errstr)
1609 0 0 if (wantarray) { }
1636 0 0 if scalar @_ != 2
1646 0 0 unless ($fh, $path) = _gettemp($template, 'open', 1, 'mkdir', 0, 'suffixlen', length $suffix, 'ErrStr', \$errstr)
1654 0 0 if (wantarray) { }
1681 0 0 if scalar @_ != 1
1686 0 0 if ($^O eq 'VMS')
1690 0 0 if ($^O eq 'MacOS' and substr($template, -1) eq ':')
1695 0 0 unless ($junk, $tmpdir) = _gettemp($template, 'open', 0, 'mkdir', 1, 'suffixlen', $suffixlen, 'ErrStr', \$errstr)
1722 0 0 if scalar @_ != 1
1728 0 0 unless ($junk, $tmpname) = _gettemp($template, 'open', 0, 'mkdir', 0, 'suffixlen', 0, 'ErrStr', \$errstr)
1787 0 0 if $tmpdir eq ''
1793 0 0 if (wantarray) { }
1825 0 0 unless unlink0($fh, $file)
1865 0 0 unless scalar @_ == 2
1937 0 0 unless scalar @_ == 2
1943 0 0 unless cmpstat($fh, $path)
1946 0 0 if (_can_unlink_opened_file()) { }
1949 0 0 if $File::Temp::KEEP_ALL
1953 0 0 if -d $path
1954 0 0 unless unlink $path
1959 0 0 if $File::Temp::DEBUG
2002 0 0 unless scalar @_ == 2
2008 0 0 if $File::Temp::DEBUG
2019 0 0 unless @fh
2021 0 0 if ($fh[3] > 1 and $^W)
2022 0 0 if $^W
2028 0 0 unless (@path)
2029 0 0 if $^W
2034 0 0 unless (-f $path)
2044 0 0 if ($^O eq 'MSWin32') { }
0 0 elsif ($^O eq 'os2') { }
0 0 elsif ($^O eq 'VMS') { }
0 0 elsif ($^O eq 'dos') { }
0 0 elsif ($^O eq 'mpeix') { }
2058 0 0 if $File::Temp::DEBUG
2062 0 0 unless ($fh[$_] eq $path[$_])
2063 0 0 if $File::Temp::DEBUG
2094 0 0 unless scalar @_ == 2
2100 0 0 unless cmpstat($fh, $path)
2103 0 0 unless close $fh
2109 0 0 if $File::Temp::KEEP_ALL
2213 0 0 if (@_)
2215 0 0 if ($level != 0 and $level != 1 and $level != 2) { }
2216 0 0 if $^W
2219 0 0 if ($] < 5.006 and $level != 0)
2225 0 0 if _can_do_level($level)
2258 0 0 if (@_)
2260 0 0 unless $newuid =~ /^\d+$/s
2408 0 0 if (@_)
2416 0 0 if ($self->unlink_on_destroy and $$ == $$self{'LAUNCHPID'} and not $File::Temp::KEEP_ALL)
2418 0 0 if -d $$self{'DIRNAME'}