Branch Coverage

lib/File/Trash.pm
Criterion Covered Total %
branch 37 66 56.0


line true false branch
18 1 17 unless @_
22 0 17 unless $count
27 16 1 if ($count == 1)
34 3 0 if _backup($_, 1)
37 0 1 unless $_count == $count
44 0 6 unless @_
48 0 6 unless $count
53 6 0 if ($count == 1)
59 0 0 if _restore($_)
62 0 0 unless $_count == $count
70 0 6 unless @_
73 0 6 unless $count
77 6 0 if ($count == 1)
83 0 0 if _backup($_)
86 0 0 unless $_count == $count
93 1 24 unless my $abs_path = Cwd::abs_path($_[0])
97 3 21 unless -f $abs_path
104 15 6 $is_trash ? :
106 0 21 unless $abs_to =~ m[^(/.+)/[^/]+$]
118 15 6 if ($is_trash) { }
119 0 15 unless File::Copy::move($abs_path, $abs_to)
121 9 6 if $File::Trash::DEBUG
125 0 6 unless File::Copy::copy($abs_path, $abs_to)
128 6 0 if $File::Trash::DEBUG
135 0 6 unless my $abs_path = Cwd::abs_path($_[0])
138 0 6 unless -f $abs_path
143 0 6 unless $abs_to =~ s/$File::Trash::ABS_TRASH//
148 0 6 if ($abs_to =~ /.+\.\d{1,10}$/)
152 3 3 if -e $abs_to and warn $File::Trash::errstr = "Restore to already exists: $abs_to, cannot restore."
156 0 3 unless ($abs_to =~ m[^(/.+)/[^/]+$])
165 0 3 unless File::Copy::move($abs_path, $abs_to)
169 0 3 if $File::Trash::DEBUG
177 0 24 unless -d $_[0] or File::Path::mkpath($_[0])