Branch Coverage

blib/lib/File/MimeInfo/Magic.pm
Criterion Covered Total %
branch 57 92 61.9


line true false branch
33 0 8 unless defined $file
35 0 8 if ref $file
36 0 8 unless -s $file and -r _
39 0 8 if $mimet = inodetype($file)
42 3 5 if $mimet
44 0 5 if $mimet = globs($file)
47 5 0 if ref $fh
49 3 2 if $mimet
55 0 8 unless defined $file
56 0 8 unless ref $file or -s $file
57 0 8 if $DEBUG
60 8 0 unless ref $file
67 1 20 unless $_hashed
70 5 16 if (ref $file) { }
71 0 16 unless open $fh, "<", $file
78 200 12 unless _check_rule($type->[$_], $fh, 0)
79 9 3 unless ref $file
91 216 0 if (ref $fh eq 'GLOB') { }
101 16 200 if $ref->[2]
102 200 16 unless $line =~ /$ref->[3]/
103 0 16 if $DEBUG
107 12 4 unless $#$ref > 4
111 4 0 if _check_rule($ref->[$_], $fh, $lev + 1)
113 0 0 if $DEBUG and not $lev
128 1 0 if -e $_
1 0 @File::MimeInfo::DIRS ? :
133 0 1 if grep {$file eq $_;} @done
150 0 1 unless readline MAGIC eq "MIME-Magic\0\n"
156 6 31 if (/^\[(\d+):(.*?)\]\n$/)
162 0 31 unless s/^(\d*)>(\d+)=(.{2})//s
172 0 31 unless /^(?:&(.{$l}))?(?:~(\d+))?(?:\+(\d+))?\n$/s
180 5 26 if ($w != 1)
182 5 0 if (2 == $w) { }
0 0 elsif (4 == $w) { }
184 0 5 if $mdef
188 0 0 if $mdef
197 2 29 if $max_buffer < $end
198 4 27 $i ? :
200 1 30 if $mdef
201 2 29 $r ? :
1 30 $mdef ? :
211 0 31 if $DEBUG
229 56 8 $m[$_] ? :
240 0 0 if ($string =~ /[\x00-\x1F\x7F]/)
243 0 0 $o == 127 ? :
0 0 $o < 32 ? :