Branch Coverage

blib/lib/File/Trash/FreeDesktop.pm
Criterion Covered Total %
branch 74 108 68.5


line true false branch
21 0 2 unless my $home = "File::HomeDir::FreeDesktop"->my_home
33 3 27 unless (-d $d)
35 0 3 unless mkdir $d, 448
49 2 18 unless (-d $d)
50 0 2 unless mkdir $d
60 0 10 unless file_exists($file0)
66 2 8 if -l $file0
69 0 10 if ($ENV{'PERL_FILE_TRASH_FREEDESKTOP_DEBUG'})
76 0 10 if ($ENV{'PERL_FILE_TRASH_FREEDESKTOP_DEBUG'})
81 10 0 if ($self->{'_home_mp'} eq $file_mp)
90 0 0 $file_mp eq '/' ? :
92 0 0 unless (-w $dir)
93 0 0 if ($ENV{'PERL_FILE_TRASH_FREEDESKTOP_DEBUG'})
99 0 0 if ($dir ne $file_mp)
101 0 0 unless $mp eq $file_mp
103 0 0 $dir eq '/' ? :
139 0 15 unless $content =~ /\A\[Trash Info\]/m
141 0 15 unless $content =~ /^Path=(.+)/m
143 0 15 unless $content =~ /^DeletionDate=(\d{4})-?(\d{2})-?(\d{2})T(\d\d):(\d\d):(\d\d)$/m
145 0 15 unless $res->{'deletion_date'} = Time::Local::timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900)
155 15 1 if (ref $_[0] eq 'HASH') { }
162 5 11 $trash_dir0 ? :
169 1 15 unless (opendir my $dh, "$trash_dir/info")
171 21 15 unless $e =~ /\.trashinfo$/
174 0 15 unless open my $fh, "<", $ifile
179 0 15 unless ref $pres
180 14 1 if (defined $opts->{'search_path'})
181 1 13 unless $pres->{'path'} eq $opts->{'search_path'}
184 4 10 if (defined $opts->{'mtime'})
186 2 2 unless not @st or $st[9] == $opts->{'mtime'}
188 5 7 if (defined $opts->{'suffix'})
189 3 2 unless $afile =~ /\.\Q$opts->{'suffix'}\E\z/
194 8 1 if defined $opts->{'search_path'}
201 0 0 unless $File::Trash::FreeDesktop::a->{'deletion_date'} <=> $File::Trash::FreeDesktop::b->{'deletion_date'}
209 3 9 if (ref $_[0] eq 'HASH') { }
217 2 10 unless (file_exists($file0))
218 1 1 if ($opts->{'on_not_found'} eq 'ignore') { }
228 0 10 unless length $name0
231 2 8 defined $opts->{'suffix'} ? :
234 2 8 $i > 1 ? :
2 10 defined $opts->{'suffix'} ? :
237 10 2 if sysopen $fh, $tinfo, 193
238 0 2 if $i >= $limit
248 0 10 unless close $fh
251 0 10 unless (rename $afile, $tfile)
262 9 5 if (ref $_[0] eq 'HASH') { }
271 3 11 if (file_exists($file0))
272 1 2 if ($opts->{'on_target_exists'} eq 'ignore') { }
285 4 7 unless (@res)
286 1 3 if ($opts->{'on_not_found'} eq 'ignore') { }
297 0 7 unless (rename $tfile, $afile)
307 1 3 defined $file0 ? :
314 0 2 unless unlink $f
326 0 1 unless defined $file