Branch Coverage

blib/lib/Text/Template/Compact.pm
Criterion Covered Total %
branch 277 388 71.3


line true false branch
12 2 1443 unless ref $_[0]
20 0 685 unless @_ and defined $_[0]
21 460 225 unless $_[0] =~ /^"/
29 865 394 if defined $_
305 60 99 if ($sub) { }
311 27 135 if @list > 1
312 36 99 if @list
321 1055 466 unless my $list = $ExprOperator{$token}
322 424 95 if $_->{'assoc'} =~ /$re/
330 285 237 unless (ref $op)
332 0 285 if $op eq 'k'
350 0 0 unless defined $mark
351 0 0 if ($self->{'op'}{'key1'} eq 'root')
352 0 0 ref $_ ? :
359 0 0 $self->{'closed'} ? :
0 0 $mark eq $self ? :
0 0 ref $_ ? :
364 753 1770 ref $_ ? :
372 0 1282 if $@
381 1222 1171 if @{$self->{'token'};}
387 486 513 if $self->{'allow_child'}
392 285 228 if @{$self->{'stack'};} == 1
397 25 203 if ($target->{'op'}{'assoc'} =~ /[ba]/) { }
398 25 0 if (defined $a and $a eq $target->{'op'}{'key2'} and @{$target->{'args'};} == $target->{'op'}{'count'})
401 0 25 if $verbose > 0
409 199 4 if (@{$target->{'args'};} == $target->{'op'}{'count'})
410 0 199 if $verbose > 0
416 4 0 if ($target->{'op'}{'assoc'} =~ /t/ and $a and $a eq $target->{'op'}{'key2'})
417 0 4 if $verbose > 0
440 0 1151 if $verbose > 0
444 969 182 unless (defined $token and findOp($token, qr/[armtk]/))
447 198 771 if $self->reduce('loop')
450 235 718 unless defined $token
452 506 212 if ($self->{'allow_child'}) { }
454 62 444 if ($op)
456 5 57 if (@{$self->{'token'};} >= 2 and $op->{'key1'} =~ /^\w/ and $self->{'token'}[1] eq '(')
460 0 5 if $verbose > 0
472 0 57 if $verbose > 0
482 444 0 if ($token =~ /^["\w\d_\$]/)
483 0 444 if $verbose > 0
490 13 227 if (defined $token and $token =~ /^["\w\d_]/ and $old_arg =~ /^\$/)
491 0 13 if $verbose > 0
502 162 50 if ($op)
510 21 171 if ($left_assoc =~ /[ba]/ and not $target->{'closed'}) { }
515 0 171 if ($right_prio == $list_op_prio)
520 24 147 unless ($a)
522 24 0 if ($left_assoc =~ /L/) { }
0 0 elsif ($left_assoc =~ /R/) { }
529 0 192 if $verbose > 0
531 162 30 if ($a > 0)
532 0 162 if $verbose > 0
539 155 7 if (@{$target->{'args'};} < $target->{'op'}{'count'})
545 0 30 unless ($self->reduce("left combination $target->{'op'}{'key1'} $op->{'key1'}"))
555 0 285 if $verbose > 0
557 0 0 defined $token ? :
0 285 unless @{$self->{'stack'};} == 1
558 0 285 unless @{$self->{'stack'}[0]{'args'};}
588 439 1331 if ($token =~ /^"/ or $token =~ /^\d/)
603 3 1942 if $path->[0] eq 'l'
609 88 494 if ($path->[0] eq 'l') { }
635 6 49 if ($path->[0] eq 'p') { }
642 2 53 if ($rel->[0] eq 'p') { }
655 0 1830 unless ref $path
661 843 987 if $path->[0] eq 'i'
664 42 945 if ($path->[0] eq 'p') { }
672 10 977 if ($path[0] eq '$') { }
2 975 elsif ($path[0] eq '$$') { }
682 27 998 if ($type eq 'ARRAY') { }
998 0 elsif ($type eq 'HASH') { }
691 1025 0 length $path_str ? :
692 0 1025 if @path and not ref $param
694 701 103 if (defined $param and not ref $param and not utf8::is_utf8($param) and defined $self->{'enc'})
708 0 405 if $path->[0] eq 'l'
710 0 405 if ($path->[0] eq 'i')
715 5 400 if ($path->[0] eq 'p') { }
723 5 400 if ($path[0] eq '$') { }
0 400 elsif ($path[0] eq '$$') { }
733 0 405 if ($type eq 'ARRAY') { }
405 0 elsif ($type eq 'HASH') { }
734 0 0 if (not @path) { }
742 405 0 if (not @path) { }
753 0 0 if @path and not ref $param
770 0 285 if $@
778 0 535 if ($@)
789 0 389 if ($@)
800 0 2 if ($@)
806 2 0 if $path->[0] =~ /[ki]/
809 0 0 if ($@)
824 0 356 if ($@)
834 20 0 if (@$list and ref $list->[0] and $list->[0]{$type})
864 6 2 unless defined $label
873 2 18 if $tag->{'indexstart'}
877 139 0 if ($tag->{'itemname'})
879 0 139 unless ref $oldr
881 4 135 if ($tag->{'indexname'})
883 0 4 unless ref $oldi
886 139 0 if ref $oldr
887 4 135 if ref $oldi
889 7 132 if ($exit_tag)
891 1 6 if dor($tag->{'label'}, '') ne &evalLabel($tmpl, $tag, $exit_tag->{'label'})
893 0 6 if $exit_tag->{'continue'}
894 6 0 if $exit_tag->{'break'}
902 3 0 if $tag->{'ex_init'}
905 1 29 if $tag->{'ex_precheck'} and not $tmpl->evalExpr($tag, $tag->{'ex_precheck'})
907 1 28 if ($exit_tag)
909 0 1 if dor($tag->{'label'}, '') ne &evalLabel($tmpl, $tag, $exit_tag->{'label'})
911 1 0 if ($exit_tag->{'break'})
916 1 27 if $tag->{'ex_postcheck'} and not $tmpl->evalExpr($tag, $tag->{'ex_postcheck'})
917 27 0 if $tag->{'ex_step'}
919 1 2 if $tag->{'ex_final'}
927 0 6 unless (defined $block)
932 6 0 unless $exit_tag
934 0 0 if dor($tag->{'label'}, '') ne &evalLabel($tmpl, $tag, $exit_tag->{'label'})
947 34 40 if @data
949 2 72 if $@
950 70 4 if $tag->{'result'}
963 0 1 if ($exit_tag and defined $exit_tag->{'label'} and defined $tag->{'label'} and $exit_tag->{'label'} eq $tag->{'label'})
978 109 166 if $value
980 24 142 if $tag->{'printer'}
990 126 0 if @data
993 0 126 if $@
995 54 72 if $value
997 24 48 if $tag->{'printer'}
1009 0 300 unless @list
1013 8 258 if (@list >= 2 and $filter_map{$list[-1]} and $list[-2] eq '#')
1021 29 323 if ($list[0] eq ';')
1027 8 315 if $filter
1030 1 280 if (@list >= 2 and $list[1] eq ':' and $list[0] =~ /^\w/)
1036 0 1 unless @list
1040 180 143 if ($list[0] eq '%') { }
1044 0 180 unless @list
1052 150 173 if ($type eq 'print') { }
6 167 elsif ($type eq 'eval') { }
25 142 elsif ($type eq 'if' or $type eq 'elsif') { }
14 128 elsif ($type eq 'ifc' or $type eq 'elsifc') { }
4 124 elsif ($type eq 'else') { }
51 73 elsif ($type eq 'end') { }
3 70 elsif ($type eq 'break' or $type eq 'continue') { }
0 70 elsif ($type eq 'end') { }
15 55 elsif ($type eq 'for') { }
3 52 elsif ($type eq 'while') { }
8 44 elsif ($type eq 'blockdefine' or $type eq 'blockpaste') { }
44 0 elsif ($type eq 'evalperl') { }
1088 1 2 if (@list and $list[0] ne ';')
1100 0 15 unless @list and $list[0] eq 'in'
1105 2 13 if @list and $list[0] ne ';'
1106 2 13 if @list and $list[0] ne ';'
1113 10 18 if ($list[0] eq $_)
1126 0 8 unless @list
1128 2 6 if ($type eq 'blockdefine')
1129 0 2 if defined $self->{'block'}{$item->{'name'}}
1135 0 44 unless @list
1136 0 44 unless $list[0] =~ /^"/
1138 40 4 if @list
1147 0 323 if @list and $list[0] ne ';'
1160 246 323 unless (ref $item)
1165 63 260 if grep {$item->{'type'} eq $_;} 'end', 'else', 'elsif', 'elsifc'
1168 2 258 if ($item->{'blockdefine'})
1171 0 2 unless eatType($rList, 'end')
1179 18 240 if ($item->{'for'} or $item->{'while'})
1182 0 18 unless eatType($rList, 'end')
1187 31 209 if ($item->{'if'} or $item->{'ifc'})
1191 0 43 unless @$rList
1193 31 12 if $item->{'next'}{'end'}
1194 0 12 if $item->{'label'} and not defined $item->{'next'}{'label'}
1204 323 370 if (ref $_) { }
1207 318 52 $_ =~ /[^\s\x{3000}]/ ? :
1210 275 124 if ($a) { }
1212 386 489 if (not ref $_ and @$rAll and not ref $rAll->[-1]) { }
1223 80 13 if ref $_
1236 62 0 ref $_[1] ? :
1245 399 300 if (defined $1) { }
1247 191 208 if length $pre
1253 179 121 if length $pre
1258 0 62 if ($lastend < length $$rText)
1284 1 0 if (defined $enc)
1285 1 0 unless ref $enc
1286 0 1 unless (ref($enc) =~ /Encode/)
1295 0 1 if (not open($fh, '<', $self->{'source_name'})) { }
1301 1 0 if defined $enc
1302 0 1 unless (close $fh)
1327 1 0 if (@_)
1336 2 0 if (@_)
1339 2 0 if (defined $enc)
1340 2 0 unless ref $enc
1341 0 2 unless ref($enc) =~ /Encode/
1351 2 0 if (@_)
1353 0 2 unless ($filtername and $filter_map{$filtername})
1365 883 870 if (not ref $item) { }
7 863 elsif ($item->{'break'} or $item->{'continue'}) { }
1371 8 855 if $exit_tag
1382 1 0 if (defined $enc) { }
1384 1 0 unless ref $enc
1385 0 1 unless ref($enc) =~ /Encode/