Branch Coverage

blib/lib/HTML/Template/Compiled/Parser.pm
Criterion Covered Total %
branch 115 142 80.9


line true false branch
182 69 0 unless $tagnames->{'1'}
186 69 0 unless $tagnames->{'2'}
201 0 131 if (ref $def eq 'ARRAY' and @$def == 4) { }
131 0 elsif (not ref $def) { }
207 91 40 if ($def =~ /^-(.*)/) { }
40 0 elsif ($def =~ /^\+?(.*)/) { }
224 519 549 if ($arg->{'template'} =~ s/^($re)//) { }
232 519 1214 if ($arg->{'open'} =~ /^$key$/i)
262 507 462 if $arg->{'template'} =~ /^($arg->{'close_match'})/
264 0 462 unless defined $name
266 0 462 if ($key =~ /^(?:PRE|POST)_CHOMP\z/ and not $val =~ /^(?:0|1|2|3)\z/)
272 2 460 if (exists $attr->{$key})
281 383 124 $validate_sub ? :
284 2 505 unless $ok
381 4 505 if ($name eq 'COMMENT') { }
2 503 elsif ($comment_info->{'COMMENT'}) { }
4 499 elsif ($name eq 'NOPARSE') { }
2 497 elsif ($comment_info->{'NOPARSE'}) { }
2 495 elsif ($name eq 'VERBATIM') { }
1 494 elsif ($comment_info->{'VERBATIM'}) { }
382 2 2 if ($arg->{'open_or_close'} == 1) { }
2 0 elsif ($arg->{'open_or_close'} == 2) { }
383 1 1 if ++$comment_info->{$name} == 1
387 1 1 if --$comment_info->{$name} == 0
396 2 2 if ($arg->{'open_or_close'} == 1) { }
2 0 elsif ($arg->{'open_or_close'} == 2) { }
397 1 1 if (++$comment_info->{$name} == 1) { }
405 1 1 if (--$comment_info->{$name} == 0) { }
417 1 1 if ($arg->{'open_or_close'} == 1) { }
1 0 elsif ($arg->{'open_or_close'} == 2) { }
418 1 0 if (++$comment_info->{$name} == 1) { }
426 1 0 if (--$comment_info->{$name} == 0) { }
468 549 519 unless $self->find_start_of_tag($arg)
473 513 6 if ($arg->{'template'} =~ s/^(($re)\s*)//) { }
1 5 elsif ($comment_info->{'NOPARSE'}) { }
0 5 elsif ($comment_info->{'VERBATIM'}) { }
1 4 elsif ($comment_info->{'COMMENT'}) { }
3 1 elsif ($self->get_strict) { }
476 124 389 if ($arg->{'name'} eq '=')
504 4 509 if ($arg->{'name'} eq 'PERL' and $self->get_perl) { }
505 0 4 unless $self->find_perlcode($arg)
508 0 505 unless $self->find_attributes($arg)
511 509 0 if ($arg->{'template'} =~ s/^($arg->{'close_match'})//) { }
521 509 552 if ($found_tag) { }
552 0 elsif ($arg->{'template'} =~ s/^(.+?)(?=($start_close_re|\Z))//s) { }
524 3 506 if exists $attr->{'PRE_CHOMP'}
526 3 506 if exists $attr->{'POST_CHOMP'}
527 3 506 if (@{$arg->{'tags'};} > 0 and $pre_chomp)
529 0 3 if ($pre_chomp == 1) { }
0 3 elsif ($pre_chomp == 2) { }
3 0 elsif ($pre_chomp == 3) { }
540 7 502 if (length $arg->{'template'} and $post_chomp)
541 4 3 if ($post_chomp == 1) { }
0 3 elsif ($post_chomp == 2) { }
3 0 elsif ($post_chomp == 3) { }
586 6 2 if defined $add_info
599 4 0 if ($arg->{'template'} =~ s/^ (.*?) (?=$arg->{'close_match'}) //sx)
613 155 307 if ($arg->{'template'} =~ s/^(\s*($re)=)//i)
618 113 349 if ($arg->{'template'} =~ s/^ (\s* (['"]) (.+?) \2 \s*) //x) { }
349 0 elsif ($arg->{'template'} =~ s/^ (\s* (\S+?) \s*) (?=$arg->{'close_match'} | \s) //x) { }
630 307 155 unless (defined $name)
656 254 392 if (defined(my $allowed = $map[$arg->{'open_or_close'}]{$arg->{'name'}}))
658 0 254 if @{$arg->{'stack'};} == 0 and @$allowed == 0
661 0 254 unless @{$arg->{'stack'};}
662 1 253 if ($allowed->[0] eq '__EOT__' and $arg->{'stack'}[-1] ne '__EOT__')
668 251 26 if $_ eq $arg->{'stack'}[-1]
678 391 252 if ($arg->{'open_or_close'} == 1) { }
252 0 elsif ($arg->{'open_or_close'} == 2) { }
679 92 299 if (grep {$arg->{'name'} eq $_;} 'WITH', 'LOOP', 'WHILE', 'IF', 'UNLESS', 'SWITCH', 'IF_DEFINED') { }
6 293 elsif ($arg->{'name'} eq 'ELSE') { }
692 89 163 if (grep {$arg->{'name'} eq $_;} 'IF', 'IF_DEFINED', 'UNLESS', 'WITH', 'LOOP', 'WHILE', 'SWITCH')