Branch Coverage

blib/lib/Text/Amuse/Preprocessor/HTML.pm
Criterion Covered Total %
branch 68 78 87.1


line true false branch
97 0 39 unless defined $rawtext
105 0 17 unless -f $text
120 39 17 if (ref $text eq 'SCALAR') { }
17 0 elsif (ref $text eq 'GLOB') { }
130 0 56 unless my $p = "HTML::PullParser"->new(%opts)
140 421 920 if ($type eq 'S') { }
422 498 elsif ($type eq 'E') { }
498 0 elsif ($type eq 'T') { }
146 47 374 if ($tag eq 'span' or $tag eq 'font') { }
6 368 elsif ($tag eq 'ol' or $tag eq 'ul') { }
103 265 elsif ($tag eq 'p' or $tag eq 'div') { }
158 310 80 if (defined $tag and exists $preserved{$tag})
161 18 292 if (ref $preserved{$tag} eq 'HASH') { }
163 18 0 if (my $parent = $lists[$#lists]) { }
177 15 375 if (defined $tag and $tag eq "a" and my $href = $attr->{'href'})
189 1 421 if ($expected ne $tag)
193 47 375 if ($tag eq 'span' or $tag eq 'font') { }
6 369 elsif ($tag eq 'ol' or $tag eq 'ul') { }
104 265 elsif ($tag eq 'p' or $tag eq 'div') { }
200 103 1 if (@parspile)
205 311 80 if ($tag and exists $preserved{$tag})
206 18 293 if (ref $preserved{$tag} eq 'HASH') { }
207 18 0 if (my $parent = $lists[$#lists]) { }
225 71 427 if ($current =~ /^(p|div)$/)
226 22 49 if ($line =~ /\A\s*([\x{a0} ]+)\s*\z/)
232 108 390 if ($current =~ /^(h[1-6]|li|ul|ol|p|div)$/)
235 491 7 if ($current ne 'pre') { }
249 766 404 if (ref $text) { }
265 0 294 unless defined $parsed
308 8 39 if (grep /italic/i, @attrsvalues) { }
8 31 elsif (grep /bold/i, @attrsvalues) { }
323 19 84 if (my $style = $attr->{'style'})
324 5 14 if ($style =~ /text-align:\s*center/i)
327 6 13 if ($style =~ /text-align:\s*right/i)
330 2 17 if ($style =~ /padding-left:\s*\d/is)
334 2 101 if (my $align = $attr->{'align'})
335 0 2 if ($align =~ /center/i)
338 2 0 if ($align =~ /right/i)
347 166 294 unless @$lines