Branch Coverage

lib/Path/Extended/Tiny.pm
Criterion Covered Total %
branch 157 200 78.5


line true false branch
27 35 192 if (ref $_[0] eq 'Path::Extended::Tiny') { }
29 35 0 if (@_)
31 1 34 if ($new->is_absolute) { }
55 18 17 -d $_[0]->_path ? :
56 51 127 $_[0][1] || $_[0][2] ? :
62 31 10 @_ == 1 ? :
67 3 28 if $self->is_open
68 26 5 if $self->exists
70 113 46 -e $_[0]->_path ? :
71 0 0 -w $_[0]->_path ? :
72 0 0 -r $_[0]->_path ? :
75 1 3 unless ($dest)
77 0 3 unless File::Copy::Recursive::rcopy($self->_path, $dest)
82 1 3 unless ($dest)
83 1 2 if $self->is_open
85 0 3 unless File::Copy::Recursive::rmove($self->_path, $dest)
91 1 3 unless ($dest)
92 1 2 if $self->is_open
93 0 3 unless rename $self->_path, $dest
104 0 2 $_[0] ? :
2 0 if (@_)
106 0 4 unless $$self[3]
111 2 70 if $self->is_open
112 22 50 if (-d $self->_path) { }
113 0 22 unless opendir my $dh, $self->_path
116 49 1 unless ($mode and $mode =~ /:/)
119 1 49 unless CORE::open my $fh, $mode, $self->_path
127 51 29 if ($$self[1])
131 22 58 if ($$self[2])
139 1 97 if ($$self[1])
140 95 2 if ($$self[2])
144 1 3 if ($$self[1])
145 1 2 if ($$self[2])
149 1 7 if ($$self[1])
150 5 2 if ($$self[2])
154 0 4 if $self->is_open
155 0 4 unless $self->exists
156 4 0 if (-d $self->_path) { }
0 0 elsif (-f $self->_path) { }
158 0 4 unless eval { do { File::Path::rmtree($self->_path, @args); 1 } }
175 1 1 if $self->is_open
176 0 2 unless CORE::sysopen my $fh, $self->_path, @_
182 1 3 unless $$self[1]
183 0 3 @_ ? :
196 64 9 if $$self[1]
204 1 1 if $$self[1]
210 1 1 if $$self[1]
215 1 1 if $$self[1]
223 0 12 unless ($self->is_open)
226 1 11 if $$opts{'binmode'}
234 1 11 if ($$opts{'chomp'})
237 2 10 if ($$opts{'decode'})
243 2 10 if ($$opts{'callback'})
247 2 10 if (my $rule = $$opts{'filter'})
250 0 12 unless defined wantarray
253 5 1 unless (@callbacks or $filter or wantarray)
262 3 12 if $filter and not $line =~ /$filter/
263 12 0 unless $$opts{'ignore_return_value'}
266 5 2 wantarray ? :
280 4 23 if ($$opts{'mkdir'})
283 0 27 $$opts{'mode'} || $$opts{'append'} ? :
285 0 27 unless ($self->is_open)
288 0 27 if ($$opts{'lock'} and not $self->lock_ex)
291 1 26 if $$opts{'binmode'}
299 2 25 if ($$opts{'encode'})
305 2 25 if ($$opts{'callback'})
311 0 27 ref $content eq 'ARRAY' ? :
315 1 26 if ($$opts{'mtime'})
323 1 23 unless $self->exists
329 1 4 unless $self->exists
330 2 2 if (@_) { }
341 23 1 unless ($self->exists)
343 0 23 unless eval { do { File::Path::mkpath($self->_path); 1 } }
350 1 1 if $_[0][2]
360 4 8 $is_dir ? :
2 10 unless $is_dir ? -d $path : -f $path
362 2 8 unless $relpath =~ /$rule/
363 0 8 if $relpath =~ m[/\.]
366 2 5 if ($opts{'callback'})
373 0 16 if $self->is_open
374 15 1 if ($self->exists and -d $self->_path)
376 0 15 unless eval { do { File::Path::rmtree($self->_path, @args); 1 } }
385 1 4 unless $self->is_open
387 1 4 unless (defined $next)
395 0 18 unless $self->open
398 36 33 if not $opts{'all'} and $path eq '.' || $path eq '..'
400 25 8 if ($opts{'prune'} or $opts{'no_hidden'})
401 0 25 if (ref $opts{'prune'} eq ref qr//) { }
0 25 elsif (ref $opts{'prune'} eq ref sub { } ) { }
402 0 0 if $path =~ /$opts{'prune'}/
405 0 0 if $opts{'prune'}(_new($child))
408 3 22 if $path =~ /^\./
423 1 4 @_ == 1 && ref $_[0] eq ref sub { } ? :
425 0 5 unless my $callback = $opts{'callback'}
447 3 1 $opts{'preorder'} ? :
1 4 $opts{'depthfirst'} && $opts{'preorder'} ? :
451 18 17 if ($entry->is_dir) { }
470 4 37 @_ == 1 && ref $_[0] eq ref {} ? :
473 0 0 if $AUTOLOAD =~ /::DESTROY$/
477 0 0 if (ref $self) { }