Branch Coverage

blib/lib/HTML/TagTree.pm
Criterion Covered Total %
branch 31 254 12.2


line true false branch
182 0 1 if (ref $class eq 'HTML::TagTree')
188 0 1 if (defined $tag_attributes and $tag_attributes ne '')
192 0 1 if (defined $content and $content ne '')
206 0 1 if (exists $$self{'parent'})
215 0 0 if (exists $$self{'attributes'})
227 0 1 if ($tag =~ /^\s*(\w+)\s+(.*)/)
235 0 1 if (exists $$self{'attributes'})
246 0 0 if (ref $content eq 'HTML::TagTree') { }
274 2 2 unless ($indent_level)
281 4 0 if ($no_whitespace_flag)
287 0 4 if (exists $tag_open_substitutions{$tag_open})
292 0 4 if ($print)
295 0 4 if (exists $$self{'attributes'} and $$self{'attributes'} ne '')
296 0 0 if (ref $$self{'attributes'} eq 'ARRAY') { }
0 0 elsif (ref $$self{'attributes'} eq 'CODE') { }
0 0 elsif (ref $$self{'attributes'} eq 'SCALAR') { }
302 0 0 if (ref $attribute eq 'CODE')
306 0 0 if (ref $attribute eq 'SCALAR') { }
324 0 0 if ($print) { }
331 0 4 if (not exists $$self{'content'} || exists $$self{'children_objs'} and exists $valid_empty_tags_for_shortening{$tag_open}) { }
336 0 0 if ($print) { }
344 0 4 if ($print) { }
351 0 4 if (exists $$self{'content'})
354 0 0 if (ref $content eq 'CODE') { }
0 0 elsif (ref $content eq 'SCALAR') { }
361 0 0 if ($print) { }
369 1 3 if (exists $$self{'children_objs'})
371 0 2 if ($print) { }
382 0 4 if (exists $tag_close_substitutions{$tag_close}) { }
384 0 0 if ($print) { }
392 0 4 if (not exists $$self{'content'} || exists $$self{'children_objs'} and exists $valid_empty_tags_for_shortening{$tag_open}) { }
399 0 4 if ($print) { }
451 0 0 if ($state eq 'looking_for_equal_sign') { }
0 0 elsif ($state eq 'getting_char_after_equal_sign') { }
0 0 elsif ($state eq 'looking_for_end_single_quote') { }
0 0 elsif ($state eq 'looking_for_end_double_quote') { }
0 0 elsif ($state eq 'looking_for_end_quote') { }
0 0 elsif ($state eq 'looking_for_start_of_whitespace') { }
0 0 elsif ($state eq 'looking_for_start_of_whitespace_to_quote_before') { }
0 0 elsif ($state eq 'looking_for_end_of_white_space') { }
0 0 elsif ($state eq 'looking_for_start_of_whitespace_while_autoquoting_value') { }
452 0 0 if ($char eq '=') { }
0 0 elsif ($char =~ /\s/) { }
465 0 0 if ($char eq $SINGLE_QUOTE) { }
0 0 elsif ($char eq $DOUBLE_QUOTE) { }
0 0 elsif ($char =~ /\s/) { }
485 0 0 if ($char eq $SINGLE_QUOTE)
491 0 0 if ($char eq $DOUBLE_QUOTE)
496 0 0 if ($char =~ /$starting_quote_type/)
502 0 0 if ($char =~ /\s/) { }
511 0 0 if ($char =~ /\s/) { }
522 0 0 if ($char =~ /\S/)
529 0 0 if ($char =~ /\s/) { }
530 0 0 unless ($autoquote_quote_type)
541 0 0 if ($char eq $DOUBLE_QUOTE) { }
0 0 elsif ($char eq $SINGLE_QUOTE) { }
542 0 0 if (not $autoquote_quote_type) { }
0 0 elsif ($autoquote_quote_type eq $DOUBLE_QUOTE) { }
550 0 0 unless ($autoquote_quote_type)
565 0 0 if ($state eq 'looking_for_start_of_whitespace_to_quote_before') { }
0 0 elsif ($state eq 'getting_char_after_equal_sign') { }
0 0 elsif ($state eq 'looking_for_end_double_quote') { }
0 0 elsif ($state eq 'looking_for_end_single_quote') { }
0 0 elsif ($state eq 'looking_for_start_of_whitespace_while_autoquoting_value') { }
581 0 0 unless ($autoquote_quote_type)
601 0 0 if ($msg)
605 0 0 if ($msg)
615 0 0 if (exists $$self{'log_routine'}) { }
621 0 0 if ($msg = !/\n$/)
638 2 0 if ($tag =~ /HTML::TagTree::(.+)/)
640 0 2 if ($tag eq 'add_content') { }
0 2 elsif (not &is_valid_html_tag($tag)) { }
653 0 2 if (defined $tag_attributes and $tag_attributes ne '')
654 0 0 if (ref $tag_attributes eq 'HASH') { }
664 0 2 if (defined $content and $content ne '')
665 0 0 if (ref $content eq 'HTML::TagTree') { }
673 0 0 if (lc $tag eq 'select') { }
695 0 0 if (ref $hash_ref eq 'HASH')
701 0 0 if (wantarray) { }
715 0 0 if (ref $content eq 'HTML::TagTree')
731 2 4 if (exists $$self{'parent'})
734 1 5 if (exists $$self{'children_objs'})
746 2 0 if (exists $valid_tags{$lc_tag})
758 0 0 if (lc $$self{'tag'} ne 'table')
764 0 0 if lc $$child_obj{'tag'} ne 'tr'
765 0 0 unless exists $$child_obj{'children_objs'}
769 0 0 if lc $$possible_td{'tag'} ne 'td'
770 0 0 unless (exists $$possible_td{'content'})
775 0 0 if (ref $value ne 'ARRAY')
781 0 0 if ($attributes =~ /colspan=['"]?(\d+)/i)
810 0 0 if ref $hash ne 'HASH'
811 0 0 if (exists $$hash{'tag_attributes'})
814 0 0 if (exists $$hash{'options'})
815 0 0 if (ref $$hash{'options'} eq 'HASH') { }
0 0 elsif (ref $$hash{'options'} eq 'ARRAY') { }
817 0 0 if (exists $$hash{'sort_sub'})
820 0 0 if (exists $$hash{'sort_numeric'})
823 0 0 if (exists $$hash{'sort_reverse_numeric'})
826 0 0 if (exists $$hash{'sort_numeric_by_value'})
829 0 0 if (exists $$hash{'sort_string_by_value'})
834 0 0 if ($$hash{'options'}{$option} eq $$hash{'selected'})
838 0 0 unless (ref $$hash{'options'}{$option})
848 0 0 if ($option eq $$hash{'selected'})
868 0 0 if (ref $checked eq 'HASH') { }
0 0 elsif (ref $checked eq 'ARRAY') { }
0 0 elsif (ref $checked eq 'SCALAR') { }
883 0 0 if (ref $values_ref eq 'ARRAY') { }
0 0 elsif (ref $values_ref eq 'HASH') { }
891 0 0 if ($self) { }
901 0 0 if (exists $$labels_ref{$value})
905 0 0 if (exists $checked{$value})
924 0 0 if (ref $checked eq 'HASH') { }
0 0 elsif (ref $checked eq 'ARRAY') { }
0 0 elsif (ref $checked eq 'SCALAR') { }
936 0 0 if (ref $inputs eq 'ARRAY') { }
0 0 elsif (ref $inputs eq 'HASH') { }
945 0 0 if ($self) { }
955 0 0 if (exists $$labels{$input})
959 0 0 if (exists $checked{$input})
982 0 0 if (ref $tags eq 'ARRAY') { }
0 0 elsif (ref $tags eq 'HASH') { }
0 0 elsif (ref $tags eq 'SCALAR') { }
0 0 elsif (ref $tags eq '') { }
1005 0 0 if (ref $tags eq 'ARRAY') { }
0 0 elsif (ref $tags eq 'HASH') { }
0 0 elsif (ref $tags eq 'SCALAR') { }
0 0 elsif (ref $tags eq '') { }