Branch Coverage

blib/lib/CodeGen/Cpppp.pm
Criterion Covered Total %
branch 55 114 48.2


line true false branch
16 0 18 if defined $newval
20 0 18 if defined $newval
24 0 18 if defined $newval
28 0 18 if defined $newval
39 7 0 !(@attrs & 1) ? :
0 7 @attrs == 1 && ref $attrs[0] ? :
44 1 6 if defined $self->{'include_path'} and ref $self->{'include_path'} ne "ARRAY"
51 0 1 unless my $path = $self->find_template($filename)
59 0 1 if $filename =~ m[/]u and -e $filename
61 0 1 if $filename =~ m[^\.?\.?/]u
65 1 0 if -e $p
72 1 3 $class_or_filename =~ /^CodeGen::Cpppp::/u && $class_or_filename->can('new') ? :
79 0 0 1 == @params && ref $params[0] eq 'HASH' ? :
4 0 !(@params & 1) ? :
90 0 15 unless (eval $perl)
104 0 15 if $line =~ /use \s+ ( v.* | ["']? [0-9.]+ ["']? ) \s* ; /ux
106 0 15 if $line =~ /use \s+ CodeGen::Cpppp \s* ( v.* | ["']? [0-9.]+ ["']? ) \s* ; /ux
108 0 15 if $line =~ /use \s+ CodeGen::Cpppp::Template \s+/u
110 15 0 if ($line =~ /^# line (\d+) "([^"]+)"/u) { }
117 0 15 if ($opts{'with_data'})
229 3 56 if ($pl =~ /(my)? \s* \b sub \s* ([\w_]+) \b \s* /ux)
233 0 3 defined $1 ? :
237 13 46 if ($pl =~ /^ \s* (param) \b /cgux) { }
0 46 elsif ($pl =~ /^ \s* (define) \s* ([\w_]+) (\s*) \(/ux) { }
240 0 13 unless $pl =~ /\G \s* ( [\$\@\%] [\w_]+ ) /cgux
243 0 13 unless $pl =~ /\G \s* ([;=]) /cgux
247 4 9 $term eq ';' ? :
267 55 13 if (defined $s->{'eval'})
269 16 39 if (defined $cache{$s->{'eval'}})
274 0 39 $s->{'eval'} =~ /self|output/u ? :
275 10 29 if ($s->{'line'} == $cur_line) { }
6 23 elsif ($s->{'line'} == $cur_line + 1) { }
287 20 6 if index($code, "\n") >= 0
293 4 0 if (grep $_->{'follows_eval'}, @{$$coltrack{$col}{'members'}}) { }
303 3 25 unless substr($text, -1) eq "\n"
304 0 28 if ($text =~ /^# line (\d+) "([^"]+)"/u)
355 55 58 if (exists $s->{'colgroup'}) { }
360 10 45 if ($CodeGen::Cpppp::parse->{'coltrack'}{$col})
361 10 0 if ($CodeGen::Cpppp::parse->{'coltrack'}{$col}{'members'}[-1]{'line'} == $s->{'line'} - 1)
372 5 40 if (substr($text, $linestart, $s->{'pos'} - $linestart) =~ /\S/u)
395 3 8 if ($CodeGen::Cpppp::parse->{'coltrack'}{$c}{'line'} < $line - 1)
406 0 0 unless $new_content =~ /\n\Z/u
408 0 0 unless open my $fh, "+<", $fname
410 0 0 unless $content =~ s/(BEGIN \Q$patch_markers\E[^\n]*\n).*?(^[^\n]+?END \Q$patch_markers\E)/$1$new_content$2/msu
412 0 0 unless $fh->seek(0, 0)
413 0 0 unless $fh->print($content)
414 0 0 unless $fh->truncate($fh->tell)
415 0 0 unless $fh->close
420 0 0 unless $new_content =~ /\n\Z/u
422 0 0 if (-e $fname)
426 0 0 unless File::Copy::copy($fname, "$fname.$n")
428 0 0 unless open my $fh, ">", $fname
429 0 0 unless $fh->print($new_content)
430 0 0 unless $fh->close
436 0 0 if (defined $patch_markers) { }
444 0 0 unless open my $fh, "<", $fname
446 0 0 unless $fh->close