Branch Coverage

lib/MIME/Types.pm
Criterion Covered Total %
branch 60 82 73.1


line true false branch
27 4 0 unless keys %typedb
42 0 4 unless open DB, "<:encoding(utf8)", $db
47 4 188 unless defined $header
52 4 184 $major eq 'EXTENSIONS' ? :
57 4 184 if ($major eq 'EXTENSIONS') { }
60 4 9012 if /^$/
61 0 9012 if $skip_section
63 9012 0 if /(.*);(.*)/
69 184 12272 if /^$/
70 0 12272 if $skip_section
72 12272 0 if /^(?:x-)?([^;]+)/
87 0 4157 if $spec eq "text"
89 0 4157 unless $spec =~ m[^(?:x\-)?([^/]+)/(?:x-)?(.*)]
92 0 4157 unless my $section = $typedb{$1}
93 0 4157 unless my $record = $section->{$2}
94 2079 2078 if ref $record
112 2 23 unless my $type = $typedb{'EXTENSIONS'}{$ext}
133 0 0 if $section eq "EXTENSIONS"
145 6 132 if $section eq "EXTENSIONS"
148 9993 0 $record =~ /^([^;]+)/ ? :
8253 9993 ref $record ? :
167 0 17 unless m[^ ([a-zA-Z0-9-]+ | \*) / ( [a-zA-Z0-9+-]+ | \* ) \s* (?: \;\s*q\=\s* ([0-9]+(?:\.[0-9]*)?) \s* )? (\;.* | ) $ ]x
173 2 15 defined $3 ? :
176 1 15 $2 eq '*' ? :
1 16 $1 eq '*' ? :
0 17 $4 ? :
189 4 4 ref $_[0] eq 'ARRAY' ? :
196 0 0 $acc eq '*' ? :
10 0 !($acc =~ s[/\*$][]) ? :
197 7 3 if defined $m
206 4 0 ref $_[0] eq 'ARRAY' ? :
0 4 !@_ ? :
208 1 3 unless (defined $accept)
216 0 6 unless my $type = $self->mimeTypeOf($fn)
222 2 1 defined $type ? :
240 5 2 defined $mime ? :
241 3 4 wantarray ? :
250 2 6 if (not ref $type and index($type, '/') >= 0) { }
252 2 0 if $mime
255 1 5 ref $type eq 'Regexp' ? :
267 4 4 wantarray ? :