Branch Coverage

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


line true false branch
65 1483 3298 if ($op eq "text" and $line =~ /$line_re/u)
68 9 1474 if ($2) { }
7 1467 elsif ($3) { }
74 717 750 $4 ? :
78 4741 36 unless $line =~ s/\\\\$/\\\n/u or $line =~ s/\\$//u
84 126 13148 if $token =~ /$cpen_re/u
87 2113 11161 if ($op ne 'text' and $token =~ /$end_re/u) { }
894 10267 elsif ($token eq $tag) { }
1150 9117 elsif ($token eq "$tag$expr") { }
59 9058 elsif ($token eq "$tag$expr$escp") { }
10 9048 elsif ($token eq "$tag$cmnt") { }
9036 12 elsif ($op ne 'cmnt') { }
90 126 1987 if $1
93 838 1275 if $trimming = $2 and @tree > 1
115 13 9023 if $token eq "$tag$replace"
118 839 8197 if ($trimming and $token =~ s/^(\s+)//u)
124 126 8910 $capture ? :
130 8 2141 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 378 168 unless ($compiled)
148 7 371 unless $compiled = eval $self->_wrap($code, @_)
155 3 46 if ref $_[0]
160 517 22 eval { do { $output = &$compiled(@_); 1 } } ? :
168 4 54 unless defined $self->{'name'}
171 1 57 if $encoding and not defined($template = decode($encoding, $template))
186 2264 10121 if $op eq "line"
190 6881 3240 if ($op eq 'text') { }
1779 1461 elsif ($op eq 'code' or $multi) { }
126 1335 elsif ($op eq 'cpen') { }
192 1752 5129 if $newline
193 2629 4252 if length $value
204 119 7 if $next->[0] ne "cpst" and ($next->[1] // "") =~ /^\s*$/u
208 1223 8898 if ($op eq "expr" or $op eq "escp")
211 1017 206 if (not $multi and $op eq 'escp' && !$escape || $op eq 'expr' && $escape) { }
192 14 elsif (not $multi) { }
222 1151 72 unless $multi or $capture
226 126 9995 if ($op eq 'cpst') { }
126 9869 elsif ($capture) { }
246 143 695 $tree->[-2][0] eq 'cpst' || $tree->[-2][0] eq 'cpen' ? :
249 11 827 unless $tree->[$i][0] eq "text"
252 22 805 if $tree->[$i][1] =~ s/(\s+)$//u
260 135 243 if ($self->vars and my(@vars) = grep({/^\w+$/u;} keys %$vars))