Branch Coverage

blib/lib/Mojo/Template.pm
Criterion Covered Total %
branch 82 82 100.0


line true false branch
65 1272 2574 if ($op eq "text" and $line =~ /$line_re/u)
68 9 1263 if ($2) { }
7 1256 elsif ($3) { }
74 612 644 $4 ? :
78 3806 36 unless $line =~ s/\\\\$/\\\n/u or $line =~ s/\\$//u
84 118 11185 if $token =~ /$cpen_re/u
87 1854 9449 if ($op ne 'text' and $token =~ /$end_re/u) { }
788 8661 elsif ($token eq $tag) { }
997 7664 elsif ($token eq "$tag$expr") { }
59 7605 elsif ($token eq "$tag$expr$escp") { }
10 7595 elsif ($token eq "$tag$cmnt") { }
7583 12 elsif ($op ne 'cmnt') { }
90 118 1736 if $1
93 732 1122 if $trimming = $2 and @tree > 1
115 13 7570 if $token eq "$tag$replace"
118 733 6850 if ($trimming and $token =~ s/^(\s+)//u)
124 118 7465 $capture ? :
130 8 1535 if $tree[-4] and $tree[-4][0] ne "line" or (not $tree[-3] or $tree[-3][0] ne "text" or not $tree[-3][1] =~ /\n$/u) or ($tree[-2][0] ne "line" or $tree[-1][0] ne "text")
145 373 165 unless ($compiled)
148 7 366 unless $compiled = eval $self->_wrap($code, @_)
155 3 43 if ref $_[0]
160 509 22 eval { do { $output = &$compiled(@_); 1 } } ? :
168 4 52 unless defined $self->{'name'}
171 1 55 if $encoding and not defined($template = decode($encoding, $template))
186 1940 8893 if $op eq "line"
190 6034 2859 if ($op eq 'text') { }
1567 1292 elsif ($op eq 'code' or $multi) { }
118 1174 elsif ($op eq 'cpen') { }
192 1529 4505 if $newline
193 2271 3763 if length $value
204 111 7 if $next->[0] ne "cpst" and ($next->[1] // "") =~ /^\s*$/u
208 1070 7823 if ($op eq "expr" or $op eq "escp")
211 864 206 if (not $multi and $op eq 'escp' && !$escape || $op eq 'expr' && $escape) { }
192 14 elsif (not $multi) { }
222 1000 70 unless $multi or $capture
226 118 8775 if ($op eq 'cpst') { }
118 8657 elsif ($capture) { }
246 129 603 $tree->[-2][0] eq 'cpst' || $tree->[-2][0] eq 'cpen' ? :
249 11 721 unless $tree->[$i][0] eq "text"
252 22 699 if $tree->[$i][1] =~ s/(\s+)$//u
260 133 240 if ($self->vars and my(@vars) = grep({/^\w+$/u;} keys %$vars))