Branch Coverage

blib/lib/File/Listing.pm
Criterion Covered Total %
branch 59 102 57.8


line true false branch
24 547 1 if @_ >= 2
25 0 548 if @_ >= 4
37 0 16465 unless length $_[0] == 10
47 16465 0 if s/^(.)//
58 74073 9216 if $1 ne "-" and $1 ne "*" and $1 ne "S" and $1 ne "T"
64 8192 8273 if /^..s....../i
65 8192 8273 if /^.....s.../i
66 2048 14417 if /^........t/i
70 0 0 unless $type eq "p" and $mode |= 4096 or $type eq "c" and $mode |= 8192 or $type eq "d" and $mode |= 16384 or $type eq "b" and $mode |= 24576 or $type eq "-" and $mode |= 32768 or $type eq "l" and $mode |= 40960 or $type eq "s" and $mode |= 49152 or $type eq "D" and $mode |= 53248
92 0 548 if (ref $dir eq 'ARRAY') { }
2 546 elsif (ref $dir eq 'GLOB') { }
0 546 elsif (ref $dir) { }
0 546 elsif ($dir =~ /^\*\w+(::\w+)+$/) { }
112 546 2 if (ref $dir eq 'ARRAY') { }
124 546 2 wantarray ? :
154 105 30 if (($kind, $size, $date, $name) = /^([\-\*FlrwxsStTdD]{10}) # Type and permission bits .* # Graps \D(\d+) # File size \s+ # Some space (\w{3}\s+\d+\s+(?:\d{1,2}:\d{2}|\d{4})|\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}) # Date \s+ # Some more space (.*)$ # File name /x) { }
9 21 elsif (/^(.+):$/ and not /^[dcbsp].*\s.*\s.*:$/) { }
21 0 elsif (/^[Tt]otal\s+(\d+)$/ or /^\s*$/) { }
0 0 elsif (/not found/ or /No such file/ or /cannot find/) { }
0 0 elsif ($_ eq '') { }
165 24 81 if $name eq "." or $name eq ".."
166 36 45 if length $curdir
168 0 81 if ($kind =~ /^l/ and $name =~ /(.*) -> (.*)/) { }
70 11 elsif ($kind =~ /^[\-F]/) { }
11 0 elsif ($kind =~ /^[dD]/) { }
185 0 9 if $dir eq "."
201 0 0 unless defined $error
202 0 0 if ref $error eq "CODE"
203 0 0 if $error eq "warn"
207 0 0 unless defined $error
208 0 0 if ref $error eq "CODE"
209 0 0 if $error eq "warn"
255 4 0 if (($date, $size_or_dir, $name) = /^(\d\d-\d\d-\d{2,4}\s+\d\d:\d\d\wM) # Date and time info \s+ # Some space (<\w{3}>|\d+) # Dir or Size \s+ # Some more space (.+)$ # File name /x) { }
263 0 4 if $name eq "." or $name eq ".."
264 0 4 if length $curdir
266 2 2 if ($size_or_dir eq '') { }
277 0 0 unless defined $error
278 0 0 if ref $error eq "CODE"
279 0 0 if $error eq "warn"
309 1608 264 if (m[.*.*?(\d+)-([a-zA-Z]+|\d+)-(\d+)\s+(\d+):(\d+)\s+(?:([\d\.]+[kMG]?|-))]i) { }
23 241 elsif (m[.*]i) { }
312 699 909 if ($m =~ /^\d+$/) { }
319 933 675 if $filesize eq "-"
320 589 1019 if ($filesize =~ s/k$//i) { }
10 1009 elsif ($filesize =~ s/M$//) { }
0 1009 elsif ($filesize =~ s/G$//) { }
333 933 675 $filename =~ s[/$][] ? :
342 6 17 $filename =~ s[/$][] ? :
355 1608 0 if ($y >= 1900) { }
0 0 elsif ($y >= 90) { }
0 0 elsif ($y < 100) { }