Branch Coverage

blib/lib/File/MimeInfo.pm
Criterion Covered Total %
branch 119 190 62.6


line true false branch
33 0 21 unless defined $file
42 0 29 if $DEBUG
43 13 16 unless lstat $file
44 14 2 if -f _
45 0 0 -S _ ? :
0 0 -b _ ? :
0 0 -c _ ? :
0 0 -p _ ? :
1 0 -d _ ? :
1 1 -l $file ? :
51 1 1 if ($t eq 'inode/directory') { }
56 0 1 if -l $file
59 0 1 unless (stat $dir)[0] == $dev
62 1 0 $t ? :
67 0 25 unless defined $file
68 1 24 unless $_hashed
70 0 25 if $DEBUG
72 1 24 if exists $literal{$file}
74 11 13 if ($file =~ /\.(\w+(\.\w+)*)$/)
78 0 16 if $DEBUG
79 0 16 if wantarray
83 0 10 wantarray ? :
10 6 if exists $extension{$ext}
89 12 2 unless $file =~ /$_->[1]/
90 0 2 if $DEBUG
94 1 11 if $file =~ /[A-Z]/
100 0 8 unless defined $file
103 0 0 do { ref $file eq 'Path::Tiny' } ? :
0 8 ref $file ? :
104 1 7 unless -f $file
105 0 7 if $DEBUG
106 1 6 if -z $file
108 0 6 unless open FILE, "<", $file
109 6 0 unless $] < "5.008"
114 0 0 unless $file->exists
115 0 0 if $DEBUG
117 0 0 unless open my $fh, "<", $file
118 0 0 unless $] < "5.008"
123 0 0 if $DEBUG
131 2 4 if ($] < 5.008 or not utf8::valid($line)) { }
134 0 2 unless $line =~ /[\x00-\x1F\x7F]/
138 3 1 unless $line =~ /[^[:print:]\s]/
141 0 3 if $DEBUG
149 1 0 if -e $_
1 4 @DIRS ? :
151 3 2 if (@globfiles) { }
159 2 3 if grep {$file eq $_;} @done
168 0 3 unless open GLOB, "<", $file
169 3 0 unless $] < "5.008"
173 3 30 if /^\s*#/ or not /\S/
176 24 3 do { $glob =~ /^\*\.(\w+(\.\w+)*)$/ } ? :
27 3 $glob =~ /[\?\*\[]/ ? :
178 3 21 if $seen_extension{$1}++
179 0 21 if (exists $extension{$1} and $extension{$1} ne $string)
181 0 0 if (defined $mime2ext{$old})
183 0 0 unless @{$mime2ext{$old};}
187 18 3 unless defined $mime2ext{$string}
189 21 0 unless grep {$_ eq $1;} @{$mime2ext{$string};}
192 0 3 unless close GLOB
204 2 0 unless $_hashed
210 1 1 unless $_hashed
211 2 0 if exists $mime2ext{$mimet}
212 1 0 $ref ? :
1 1 if wantarray
213 1 0 $ref ? :
217 0 2 if ref $_[0]
219 0 2 unless $mt
221 2 0 unless defined $lang
222 1 1 $lang ? :
225 0 0 if -e $_
0 2 @DIRS ? :
229 0 2 unless open XML, "<", $file
230 2 0 unless $] < "5.008"
232 18 2 unless m[(.*?)]
236 0 2 unless close XML
237 2 0 if $desc
244 0 16 unless defined $mimet
245 2 14 unless $_hashed_aliases
246 1 15 exists $aliases{$mimet} ? :
257 0 0 if -e $_
0 3 @DIRS ? :
261 3 3 if grep {$_ eq $file;} @done
262 0 3 unless open MAP, "<", $file
263 3 0 unless $] < "5.008"
265 0 6 unless $line =~ /\S/
266 0 6 if $line =~ /^\s*#/
269 2 4 if ($list) { }
270 1 1 unless $map{$k}
284 2 3 if (ref $mimet or not defined $mimet) { }
292 1 4 unless $_hashed_subclasses
295 1 4 if $mimet eq "inode/mount-point"
296 2 3 if exists $subclasses{$mimet}
297 2 3 if $mimet =~ m[^text/]
298 4 1 unless $mimet =~ m[^inode/]
300 3 2 $parent ? :