Branch Coverage

blib/lib/HTML/ExtractText.pm
Criterion Covered Total %
branch 42 52 80.7


line true false branch
18 0 13 unless get_args_as_hash(\@_, \my %args, {'separator', "\n", 'ignore_not_found', 1}, [], ['separator', 'ignore_not_found'])
38 0 11 unless ref $what eq 'HASH'
42 0 11 unless defined $html
46 3 8 if (defined $obj)
47 1 2 unless &blessed($obj)
51 1 1 unless $obj->can($_)
69 1 0 unless @results or $self->ignore_not_found
72 10 12 if (defined(my $sep = $self->separator)) { }
89 1 8 if (defined $obj)
97 1 8 if ($did_have_error) { }
107 15 24 if (@_)
113 14 2 if (@_)
119 20 13 if (@_)
125 14 3 if (@_)
137 20 7 unless $tag =~ /input|img/
139 3 4 if $tag eq 'img' or $tag eq 'input' and ($_->attr('type') // '') eq 'image'
159 0 22 if $_->[1] eq 'pre'
20 0 if $trim and $tree->[0] ne 'root'
171 4 0 unless $nodes->[$i][0] eq 'text' and $next->[0] eq 'text'
181 23 3 if ($type eq 'text') { }
1 2 elsif ($type eq 'cdata' or $type eq 'raw') { }
2 0 elsif ($type eq 'tag') { }
183 23 0 if ($trim)
196 0 2 $node->[1] eq 'pre' ? :
200 1 25 if $text =~ /\S\z/ and $chunk =~ /^[^.!?,;:\s]+/
203 23 3 if $chunk =~ /\S+/ or not $trim