Branch Coverage

blib/lib/Pod/HTML2Pod.pm
Criterion Covered Total %
branch 77 256 30.0


line true false branch
298 0 1 unless @_
299 0 1 if @_ % 2
305 0 1 if (exists $o{'debug'})
313 0 1 if (exists $o{'tree'}) { }
316 0 0 unless defined $tree
317 0 0 unless ref $tree
318 0 0 unless $tree->isa('HTML::Element')
324 0 1 if (exists $o{'file'})
325 0 0 unless -e $o{'file'}
327 0 0 unless open IN, "<$o{'file'}"
330 0 0 if $Pod::HTML2Pod::Debug
334 0 1 if (exists $o{'handle'})
339 0 0 if $o{'_close_after'}
341 0 0 if $Pod::HTML2Pod::Debug
344 1 0 if (exists $o{'content'}) { }
346 0 1 if (not defined $o{'content'}) { }
0 1 elsif (ref $o{'content'}) { }
349 0 0 unless ref $o{'content'} eq 'SCALAR'
360 0 1 if (do { $$content_r =~ /(\cm\cj|\cm|\cj)/ })
364 0 0 if ($nl eq "\n") { }
366 0 0 if $Pod::HTML2Pod::Debug
368 0 0 unless ($is_copy)
373 0 0 if ($nl eq "\r") { }
0 0 elsif ($nl eq "\n") { }
0 0 elsif ($nl eq "\r\n") { }
375 0 0 if $Pod::HTML2Pod::Debug
378 0 0 if $Pod::HTML2Pod::Debug
382 0 0 if $Pod::HTML2Pod::Debug
409 0 1 if ($o{'a_name'}) { }
416 0 1 if ($o{'a_href'}) { }
577 0 1 if $Pod::HTML2Pod::Debug
645 0 1 if $Pod::HTML2Pod::Debug > 1
664 0 0 unless defined $a_name
667 0 0 unless $parent->tag eq '~texticle'
670 0 0 unless $gptag eq 'h1' or $gptag eq 'h2' or $gptag eq 'item'
671 0 0 unless $parent->content_list == 1 and $grandparent->content_list == 1
674 0 0 unless @cl == 1 and ref $cl[0] and $cl[0]->tag eq '~literal'
676 0 0 unless defined $text
679 0 0 if ($a_name eq $text) { }
681 0 0 if $Pod::HTML2Pod::Debug > 1
683 0 0 if $Pod::HTML2Pod::Debug > 1
700 0 0 if ($p->parent->tag eq 'p')
752 0 0 if ref $c and not $Pod::HTML2Pod::Phrasal{$c->tag}
755 0 1 if (@non_phrasal_children)
827 0 1 if (@levels == 0) { }
830 0 1 if $Pod::HTML2Pod::Debug
838 0 0 if @levels and $Pod::HTML2Pod::Debug
848 0 1 if ($h->parent->is_inside('h1', 'h2'))
857 0 1 if (not @c) { }
0 1 elsif ($c[0]->tag ne '~texticle') { }
863 0 1 if (@c > 1)
871 0 1 unless $h->parent eq $tree
889 0 1 if ($children[$i]->tag eq 'p')
905 0 1 if ($dirty)
915 0 0 if (not @c) { }
0 0 elsif (@c == grep({$_->tag eq '~texticle';} @c)) { }
940 0 1 if (@c > 1)
943 0 0 if $Pod::HTML2Pod::Debug
963 1 1 if (ref $c) { }
971 1 1 if ($dirty)
993 2 1 unless ($Pod::HTML2Pod::Phrasal{$node->tag})
998 1 1 unless $Pod::HTML2Pod::Phrasal{$children[$i]->tag}
1000 1 0 if ($i == 0 or not $Pod::HTML2Pod::Phrasal{$last_tag = $children[$i - 1]->tag}) { }
0 0 elsif ($last_tag eq '~texticle') { }
1035 0 2 if ($children[$i]->tag eq 'br')
1045 1 2 if ($dirty)
1055 0 1 unless $hr and ref $hr eq 'HASH'
1059 1 1 if (ref $c)
1060 0 1 if ($tag = $c->tag and defined $tag and exists $$hr{$tag})
1087 0 0 unless (ref $c)
1100 0 0 if ($dirty)
1113 0 2 if (($tag = $node->tag) eq 'ul' or $tag eq 'menu') { }
0 2 elsif ($tag eq 'ol') { }
0 2 elsif ($tag eq 'dl') { }
0 2 elsif ($tag eq 'blockquote') { }
1117 0 0 unless ref $c and $c->tag eq 'li'
1128 0 0 unless ref $c and $c->tag eq 'li'
1139 0 0 unless ref $c
1140 0 0 if (($tag = $c->tag) eq 'dt') { }
0 0 elsif ($tag eq 'dd') { }
1162 1 1 if ref $c
1181 0 0 if ($hr->parent->tag eq 'body') { }
1205 0 0 if (defined $left and not ref $left and $left =~ /^\s*$/s)
1213 0 0 if (defined $right and not ref $right and $right =~ /^\s*$/s)
1222 0 0 unless ($text_content =~ /\S+/)
1231 0 0 if ($left and ref $left and $left->tag eq 'pre') { }
1260 0 0 if (defined($alt = $img->attr('alt'))) { }
1263 0 0 $Pod::HTML2Pod::Debug ? :
1279 2 0 ref $o ? :
1289 1 0 ref $o ? :
1309 1 2 if ($tag eq 'body') { }
0 2 elsif ($tag eq 'pre') { }
0 2 elsif ($tag eq 'over') { }
0 2 elsif ($tag eq 'item') { }
1 1 elsif ($tag eq 'h1') { }
0 1 elsif ($tag eq 'h2') { }
1 0 elsif ($tag eq '~texticle') { }
1313 0 0 if $lines[-1] =~ /^\S/m
1337 1 0 if (@lines and $lines[-1] =~ /^=(\w{1,10})$/s and $1 eq 'item' || $1 eq 'head1' || $1 eq 'head2')
1348 0 1 unless length $lines[-1]
1353 0 0 if $Pod::HTML2Pod::Debug
1366 0 1 unless @lines and $lines[0] =~ /^=/s
1372 1 0 if ($comments and @$comments)
1375 4 1 unless $c =~ /^\s*#/s
1380 0 1 if $Pod::HTML2Pod::Debug > 1
1398 1 1 if ($tag eq '~texticle') { }
1 0 elsif ($tag eq '~literal') { }
0 0 elsif ($tag eq 'code') { }
0 0 elsif ($tag eq 'i') { }
0 0 elsif ($tag eq 'b') { }
0 0 elsif ($tag eq 'a') { }
1404 1 0 if defined $Pod::HTML2Pod::nbsp
1410 0 1 if ($under_l_count) { }
1425 0 1 unless defined $content
1436 0 0 $a_name ? :
1437 0 0 $a_href ? :
1440 0 0 if (defined $name and length $name)
1444 0 0 if (defined $href and length $href)
1447 0 0 if ($href =~ s/^#//s) { }
0 0 elsif ($href =~ s/^pod://s) { }
0 0 elsif ($href =~ /^[-+.a-z0-9A-Z]+\:[^:]/s) { }
1484 0 2 if $decr_under_l_count_post
1512 0 2 unless length $w
1513 0 2 if (length $w >= 72) { }
2 0 elsif (1 + $col + length($w) < 72) { }
1515 0 0 if ($col) { }
1523 1 1 if ($col) { }
1532 0 0 if ($col) { }