Branch Coverage

blib/lib/HTML/Macro.pm
Criterion Covered Total %
branch 200 316 63.2


line true false branch
62 4 4 if ($protect_whitespace) { }
69 2 2 unless ($blank_lines_only)
77 4 4 if ($tag eq "/$protect_whitespace") { }
4 0 elsif (not $protect_whitespace || $tag =~ m[^/]) { }
86 4 17 if $pos
87 2 19 unless ($blank_lines_only)
108 0 0 if ($$self{'@attr'}{'debug'})
115 0 0 if $loop
118 0 0 unless $p
119 0 0 if ($p->isa('HTML::Macro::Loop'))
122 0 0 unless $p
125 0 0 unless ($loop)
129 0 0 unless (ref $loop and $loop->isa('HTML::Macro::Loop'))
134 0 0 if ($element =~ /\bseparator="([^\"]*)"/ or $element =~ /\bseparator=(\S+)/)
140 0 0 if ($element =~ /\bseparator_final="([^\"]*)"/ or $element =~ /\bseparator_final=(\S+)/)
155 0 6 if ($$self{'@attr'}{'debug'})
159 3 3 if ($body) { }
172 5 1 if ($attr eq 'expr') { }
1 0 elsif ($attr eq 'func') { }
181 0 6 if ($@)
190 15 0 defined $$hash{$key} ? :
63 0 defined $$hash{lc $key} ? :
0 0 defined $$hash{uc $key} ? :
0 9 exists $$hash{uc $key} ? :
63 9 exists $$hash{lc $key} ? :
15 72 exists $$hash{$key} ? :
202 0 84 if ($$self{'@attr'}{'debug'})
212 5 79 if $$self{'@ovalues'}
213 82 2 unless defined $val
214 78 6 if defined $val
221 0 6 if ($dynamic)
241 67 237 if ($html =~ /((\#{1,2})(\@?\w+)\2)/gs)
251 47 28 $quoteit ? :
75 1 defined $val ? :
254 67 9 unless ($html =~ /\G.*?((\#{1,2})(\@?\w+)\2)/gs)
271 0 32 if (substr($fname, 0, 1) eq '/') { }
273 0 0 if @stat
276 32 0 unless $$self{"\@no_local_incpa\\\nth"}
282 32 4 if @stat
300 0 32 unless open FILE, $path
302 0 32 if ($$self{'@attr'}{'debug'})
313 32 0 if ($path =~ m[(.*)/([^/])+$]) { }
323 0 32 unless $dir =~ m[^([A-Za-z]:)?/]
344 1 12 if ($global) { }
357 0 14 unless ($include =~ m[]sig)
363 0 14 if ($asis) { }
5 9 elsif ($body) { }
370 0 0 if ($lastdir) { }
407 40 316 if defined $$self{'@' . $key}
415 57 9 if ($attrs =~ /^\s* expr \s* = \s* "([^\"]*)" \s*$/six) { }
8 1 elsif ($attrs =~ /^\s* (n?)def \s* = \s* "([^\"]*)" \s*$/six) { }
420 0 57 if ($@)
430 0 8 if $ndef
443 3 54 unless $buf
458 1 53 $$self{'@attr'}{'precompile'} ? :
459 0 54 if $$self{'@attr'}{'debug'}
461 13 41 unless $$self{'@caller_package'}
474 258 21 unless $slash
475 0 279 if (not $slash and $tag eq 'elsif')
480 56 223 if $slash
483 159 120 if ($active) { }
8 112 elsif ($quoting) { }
94 18 elsif (not $looping) { }
493 5 3 if ($tag eq '/quote') { }
0 3 elsif ($tag eq 'quote') { }
496 0 5 unless $matching_tag
499 0 5 if $start_tag ne 'quote'
502 5 0 if ($emitting and not $attr)
512 1 4 $quoting == 2 ? :
536 10 256 if ($tag eq 'loop' or $tag eq 'eval' or $tag eq 'include' or $tag eq 'define')
543 0 15 if ($tag eq 'loop') { }
5 10 elsif ($tag eq 'eval') { }
5 5 elsif ($tag eq 'include') { }
5 0 elsif ($tag eq 'define') { }
544 0 0 unless $match =~ /id="([^\"]*)"/ or $match =~ /id=(\S+)/
549 0 5 unless $match =~ /(expr|func)="([^\"]*)"/
556 0 5 unless $match =~ /(name)="([^\"]*)"/
565 10 241 if ($tag eq '/loop' or $tag eq '/eval' or $tag eq '/include' or $tag eq '/define')
568 0 15 unless $matching_tag
571 0 15 if $start_tag ne substr($tag, 1)
576 14 1 if ($true and not $looping and not $quoting)
579 0 14 if ($tag eq '/loop') { }
4 10 elsif ($tag eq '/eval') { }
5 5 elsif ($tag eq '/include') { }
5 0 elsif ($tag eq '/define') { }
590 0 5 if $@
600 5 236 if ($tag eq 'quote')
603 2 3 if ($match =~ /preserve="([^\"]*)"/) { }
608 1 1 if ($result) { }
612 1 0 unless $looping
616 1 0 if ($match =~ /expr="([^\"]*)"/) { }
621 1 0 if ($result)
629 0 2 if ($@)
639 0 236 if ($tag eq '/quote')
642 0 0 unless $matching_tag
645 0 0 if $start_tag ne substr($tag, 1)
650 2 234 if $looping
652 90 144 if (substr($tag, 0, 1) eq '/') { }
66 78 elsif ($tag eq 'if') { }
13 65 elsif ($tag eq 'elsif/') { }
45 20 elsif ($tag eq 'else/' or $tag eq 'else') { }
656 0 90 unless $matching_tag
659 1 89 if ($tag eq '/if' and $start_tag eq 'elsif')
661 0 1 unless $matching_tag
665 0 90 if $start_tag ne substr($tag, 1)
669 65 25 if ($start_tag eq 'if')
677 61 5 if ($active)
685 9 4 if ($last_tag eq 'if') { }
4 0 elsif ($last_tag eq 'elsif') { }
694 3 10 if (not $looping and $$top[1] and $$top[2]) { }
5 10 elsif (not $looping and $$top[1] and not $$top[2]) { }
713 8 37 if ($last_tag eq 'elsif') { }
37 0 elsif ($last_tag eq 'if') { }
719 4 4 if $$top[1]
721 37 0 if not $looping and $$top[1]
726 25 20 if $tag eq 'else'
730 94 139 unless $active
732 9 130 if ($tag eq 'include/') { }
8 122 elsif ($tag eq 'define/') { }
2 120 elsif ($tag eq 'eval/') { }
739 0 8 unless $match =~ /name="([^\"]*)"/
743 0 8 unless $match =~ /value="([^\"]*)"/
751 1 1 if ($match =~ /expr="([^\"]*)"/) { }
1 0 elsif ($match =~ /func="(\w+)"/) { }
771 1 52 if ($$self{'@attr'}{'collapse_whitespace'}) { }
12 40 elsif ($$self{'@attr'}{'collapse_blank_lines'}) { }
781 0 53 if $$self{'@attr'}{'debug'}
789 0 32 unless $$self{'@cwd'}
794 0 32 unless ($path)
798 0 0 if ($$self{'@attr'}{'cache_files'} and exists $HTML::Macro::file_cache{$key} and $HTML::Macro::file_cache{$key . '@mtime'} >= $mtime)
833 1 31 if ($$self{'@attr'}{'collapse_whitespace'}) { }
7 24 elsif ($$self{'@attr'}{'collapse_blank_lines'}) { }
844 0 32 if ($$self{'@attr'}{'cache_files'})
867 32 3 if $fname
872 31 3 if ($lastdir) { }
900 0 1 unless $$self{'@caller_package'}
902 1 0 if $$self{'@file'}
904 1 0 if ($pos)
922 0 0 unless $$self{'@caller_package'}
924 0 0 if $$self{'@file'}
925 0 0 if ($pos)
948 0 35 if @_
955 7 0 unless $self
957 0 0 if ($self->isa('HTML::Macro::Loop'))
960 0 0 unless ($self)
992 0 2 if @_
998 0 1 unless $$self{'@cwd'}
1001 1 0 unless $dir =~ m[/$]
1002 1 0 unless ($dir =~ m[^(?:[A-Za-z]:)?/])
1017 0 0 defined $val ? :
1036 3 0 unless defined $$self{$var}
1064 0 13 if ($attr) { }
1065 0 0 if (ref $attr ne 'HASH')
1075 0 13 if $fname
1084 0 0 if ($name)
1086 0 0 if (@loop_vars)
1097 1 0 if $$self{'@ovalues'}
1098 0 1 if $self->parent