Branch Coverage

blib/lib/Module/Compile.pm
Criterion Covered Total %
branch 64 94 68.0


line true false branch
48 0 8 if $class->pmc_use_means_no
55 0 0 unless $class->pmc_use_means_no
64 5 3 if $class->pmc_set_base(@args)
68 0 3 if $filtered->{$module}++
89 1 2 if (defined $file and not $file =~ /\.pm$/i)
92 0 1 if -s $pmc and -M $pmc <= -M $file
101 0 0 if $@
112 5 3 if ($class->isa('Module::Compile') and defined $flag and $flag eq '-base')
139 0 3 unless open my $fh, '<', $module
158 0 3 unless $class->pmc_can_output($module)
164 0 3 unless open my $fh, '>', $pmc
170 0 3 unless print $fh $output
172 0 3 unless close $fh
175 0 3 if (my $e = $@)
177 0 0 if (-e $pmc)
178 0 0 unless unlink $pmc
201 0 3 unless open my $fh, $module
210 2 1 if ($folded_content =~ s/^((?:__(?:DATA|END)__$).*)//ms)
227 1 3 if $done
231 1 37 unless $status
232 0 37 if $status < 0
234 35 2 if $lines_to_skip-- > 0
235 2 0 if (/^__(?:END|DATA)__$/)
283 5 14 if (@blocks == 1 and @{$blocks[0][2];} == 0)
285 0 5 unless $content =~ /\n\z/
304 13 31 if ($next and join($", @{$block->[2];}) eq join($", @{$next->[2];})) { }
8 23 elsif (!$prev || @{$prev->[2];} < @{$block->[2];} and !$next || @{$next->[2];} < @{$block->[2];}) { }
312 8 0 $prev ? :
313 5 3 $next ? :
314 0 8 $prev_len > $next_len ? :
337 5 3 defined $return && !($return =~ /^\d+\z/) ? :
355 15 20 if ($part =~ /^[^\S\n]*(use|no)[^\S\n]+([\w\:\']+)[^\n]*\n/) { }
358 0 15 if ($klass =~ /^\d+$/)
365 0 15 if $@ and not "$@" =~ /^Can't locate /
367 11 4 if ($klass->can('pmc_is_compiler_module') and $klass->pmc_is_compiler_module) { }
372 8 3 if ($use eq 'use' xor $klass->pmc_use_means_no) { }
374 8 0 unless $context->{$klass}
376 2 6 if ($klass->pmc_use_means_now)
394 5 0 if length $text
459 12 20 unless $source =~ s[ ( $re_pod | $re_comment | $re_here | $re_data ) ][my $result = $1; $result =~ /\A($re_data)/ ? $class->pmc_fold_data : ($result =~ /\A($re_pod)/ ? $class->pmc_fold_pod : ($result =~ /\A($re_comment)/ ? $class->pmc_fold_comment : ($result =~ /\A($re_here)/ ? $class->pmc_fold_here : die("'${result}' didn't match '${re_comment}'"))));]ex
468 10 0 $result =~ /\A($re_here)/ ? :
4 10 $result =~ /\A($re_comment)/ ? :
3 14 $result =~ /\A($re_pod)/ ? :
3 17 $result =~ /\A($re_data)/ ? :
500 0 3 unless $match =~ s/.*?([0-9a-fA-F]{40}).*/$1/s
516 2 10 if ($text =~ s/^(([0-9a-fA-F]{40})\n.*\n)//)
517 2 0 if (defined $digest_map->{$2}) { }