Branch Coverage

blib/lib/Text/MicroTemplate.pm
Criterion Covered Total %
branch 81 98 82.6


line true false branch
38 2 25 ref $_[0] ? :
27 11 @_ == 1 ? :
40 30 8 if (defined $$self{'template'})
43 36 2 unless (defined $$self{'package_name'})
47 32 26 unless ($c =~ /^Text::MicroTemplate\b/)
58 0 0 if (@_)
66 0 1 if (@_)
76 54 3 unless (defined $$self{'code'})
89 53 1 ref $escape_func eq 'CODE' ? :
103 46 126 if ($type ne 'text' and defined $last_text)
106 29 17 $j == 0 && @lines >= 2 ? :
116 22 150 if ($last_was_code and $type ne 'code')
122 99 73 if ($type eq 'text')
126 75 24 if $newline
128 18 81 defined $last_text ? :
132 30 142 if ($type eq 'code')
138 43 129 if ($type eq 'expr')
140 1 42 if ($newline and $value =~ /\n/)
149 3 51 if ($last_was_code)
153 35 19 if (defined $last_text)
158 53 1 @lines ? :
188 121 21 if (@lines)
193 130 12 if ($state eq 'text')
195 24 106 if ($line =~ /^$line_start\s+(.*)$/)
200 7 99 if ($line =~ /^$line_start$expr_mark\s+(.+)$/)
201 7 0 $newline ? :
208 10 89 if ($line =~ /^$line_start$cmnt_mark/)
215 0 101 if ($line =~ /(\\+)$/) { }
218 0 0 if ($length == 1)
222 0 0 if ($length >= 2)
227 80 21 if $newline
244 26 232 if ($token eq '') { }
42 190 elsif ($token =~ /^$tag_end$/) { }
6 184 elsif ($token =~ /^$tag_start$/) { }
2 182 elsif ($token =~ /^$tag_start$cmnt_mark$/) { }
36 146 elsif ($token =~ /^$tag_start$expr_mark$/) { }
261 92 54 if ($state eq 'text') { }
2 52 elsif ($state eq 'cmnt') { }
10 42 elsif ($state eq 'cont') { }
273 89 12 if ($state eq 'text')
278 0 54 if @$tokens
288 0 0 0 < $_ && $_ <= @lines ? :
298 0 1 if ($error =~ /^(.*)\s+at\s+\(eval\s+\d+\)\s+line\s+(\d+)/)
343 0 0 unless defined $str
345 0 0 if ref $str eq 'Text::MicroTemplate::EncodedString'
358 23 27 if $_mt_setter
363 50 54 if $c[0] ne 'Text::MicroTemplate'
387 49 1 if (my $_builder = eval $expr)
418 1 1 if ($retval =~ /^\d+$/ and $_ ne $$mtref or defined $retval and not $retval) { }