Branch Coverage

blib/lib/Template/Direct/Conditional.pm
Criterion Covered Total %
branch 86 114 75.4


line true false branch
66 0 56 if ref $template ne 'SCALAR'
72 38 18 if ($section)
77 5 33 unless ($self->hasSubTag('else'))
90 18 28 if ($cond) { }
117 0 46 if $string eq 'else'
128 2 116 if ($raw =~ s/^\(//) { }
1 115 elsif ($raw =~ s/^\{//) { }
131 2 0 if $current
137 1 0 if $current
141 2 116 if (ref $current eq 'Template::Direct::Conditional::Array') { }
142 1 1 if $raw =~ s/\}$//
144 1 1 if $end and @depths
146 11 105 if ($raw eq 'and' or $raw eq 'or') { }
155 57 48 if ($sane =~ /^\$(.+)$/)
158 3 102 if (UNIVERSAL::isa($sane, 'ARRAY') and not UNIVERSAL::isa($sane, 'HASH'))
163 88 17 if defined $sane and scalar $sane . '' ne ''
165 2 103 if ($raw =~ /\)$/)
166 2 0 if @depths
188 11 91 if (ref $token eq 'SCALAR') { }
2 89 elsif (ref $token eq 'Template::Direct::Conditional::Tokens') { }
189 0 11 if @stack == 0
201 0 48 if @stack == 0 and @tokens != 0
202 37 11 @tokens == 0 ? :
226 2 116 unless defined $list
243 17 53 if @t == 0
244 17 36 if @t == 1
249 3 33 if ($t[0] eq 'not')
250 2 0 $t[1] ? :
2 1 if @t == 2
258 0 34 if $a and $a eq 'not'
260 0 34 unless $o
262 0 34 if $b and $b eq 'not'
264 11 23 if ref $a eq 'Template::Direct::Conditional::Tokens'
265 11 23 if ref $b eq 'Template::Direct::Conditional::Tokens'
270 0 34 if $o eq '>'
271 0 34 if $o eq '<'
272 0 34 if $o eq '>='
273 0 34 if $o eq '<='
276 0 34 if $o eq '|'
277 0 34 if $o eq '&'
280 4 6 $a && $b ? :
10 24 if $o eq 'and'
281 1 0 $a || $b ? :
1 33 if $o eq 'or'
282 7 13 $a eq $b ? :
20 14 if $o eq '=' or $o eq 'eq'
283 0 0 $a ne $b ? :
0 34 if $o eq '!=' or $o eq 'ne'
285 3 31 if ($o eq 'in')
286 3 0 if (ref $b eq 'Template::Direct::Conditional::Array') { }
288 2 1 $b->in($a) ? :
295 0 0 $a % $b == 0 ? :
0 34 if $o eq '@'
297 34 0 if (@t == 1) { }
300 0 0 'Template::Direct::Conditional::Tokens'->new(\@t)->execute ? :
363 1 3 unless defined $list
375 2 3 if $i eq $var