Branch Coverage

lib/File/PathInfo.pm
Criterion Covered Total %
branch 87 136 63.9


line true false branch
35 10 9 unless (ref $self)
36 6 4 if $File::PathInfo::DEBUG
42 3 7 unless $self->set($arg)
10 9 if ($arg)
54 8 13 unless ($self->_abs)
65 0 21 unless $$self{'_data'}{'_argument'}
75 21 155 unless (defined $$self{'_data'}{'_abs'})
92 4 17 if ($argument =~ m[^/]) { }
12 5 elsif ($argument =~ m[^\./]) { }
94 0 4 if (RESOLVE_SYMLINKS()) { }
102 0 4 unless ($abs_path)
103 0 0 if $File::PathInfo::DEBUG
113 1 11 unless ($abs_path = Cwd::abs_path(cwd() . '/' . $argument))
114 1 0 if $File::PathInfo::DEBUG
124 0 5 unless ($self->DOCUMENT_ROOT)
125 0 0 if $File::PathInfo::DEBUG and return 0
130 0 5 unless ($abs_path = Cwd::abs_path($self->DOCUMENT_ROOT . '/' . $argument))
131 0 0 if $File::PathInfo::DEBUG
144 0 20 unless $$_abs{'abs_path'} = $abs_path
146 18 2 unless (defined $$self{'check_exist'})
149 20 0 if ($$self{'check_exist'})
150 7 13 unless (-e $$_abs{'abs_path'})
151 4 3 if $File::PathInfo::DEBUG
159 0 13 unless $abs_path =~ m[^(/.+)/([^/]+)$]
165 9 4 if ($$_abs{'filename'} =~ /^(.+)\.(\w{1,4})$/) { }
183 0 32 if $self->errstr
185 12 20 unless (defined $$self{'_data'}{'_rel'})
191 0 12 unless $self->DOCUMENT_ROOT
195 0 12 unless my $abs_path = $self->abs_path
197 0 12 if ($doc_root eq $abs_path) { }
204 3 9 unless ($self->is_in_DOCUMENT_ROOT)
205 0 3 if $File::PathInfo::DEBUG
211 0 9 unless $rel_path =~ s[^$doc_root/][]
215 6 3 if ($rel_path =~ m[^(.+)/([^/]+)$]) { }
219 0 6 unless $filename eq $self->filename
239 0 10 unless defined $self->DOCUMENT_ROOT
240 7 3 unless $self->abs_loc eq $self->DOCUMENT_ROOT
246 0 10 unless defined $self->DOCUMENT_ROOT
247 10 0 unless $self->abs_path eq $self->DOCUMENT_ROOT
252 3 28 unless $self->exists
256 2 26 unless $abs_path =~ m[^$document_root/]
263 0 0 unless defined $abs
264 0 0 unless -d $abs
276 0 116 if $self->errstr
279 16 100 unless (defined $$self{'_data'}{'DOCUMENT_ROOT'})
283 0 16 if ($$self{'DOCUMENT_ROOT'}) { }
16 0 elsif ($ENV{'DOCUMENT_ROOT'}) { }
284 0 0 unless $abs_document_root = Cwd::abs_path($$self{'DOCUMENT_ROOT'})
289 0 16 unless $abs_document_root = Cwd::abs_path($ENV{'DOCUMENT_ROOT'})
302 3 29 unless ($self->exists)
306 0 29 if $self->errstr
308 4 25 unless (defined $$self{'_data'}{'_stat'})
311 0 4 unless my(@stat) = stat $self->abs_path
313 4 0 -f _ ? :
0 4 -d _ ? :
1 3 -B _ ? :
3 1 -T _ ? :
4 0 $self->DOCUMENT_ROOT ? :
4 0 $self->DOCUMENT_ROOT ? :
373 18 35 unless defined $v
383 1 177 if $_[0]
389 0 66 unless defined $$self{'_data'}{'exists'}
398 0 4 if $absPath =~ m[^/$]
403 0 11 if ($elems[$ptr] eq '') { }
0 11 elsif ($elems[$ptr] eq '.') { }
0 11 elsif ($elems[$ptr] eq '..') { }
413 0 0 if ($ptr < 2) { }
428 4 0 $#elems ? :