Branch Coverage

blib/lib/HTML/TagParser.pm
Criterion Covered Total %
branch 104 134 77.6


line true false branch
237 7 19 unless defined $src
239 1 18 if ($src =~ m[^https?://\w]) { }
12 6 elsif (not $src =~ /[<>|]/ and -f $src) { }
6 0 elsif ($src =~ /<.*>/) { }
255 0 2 unless (defined $URI::Fetch::VERSION)
258 0 0 if $@
261 0 2 unless ref $res
262 0 2 if $res->is_error
272 0 13 unless defined $text
282 15 10 ref $text ? :
286 11 14 if ($charset and &Encode::find_encoding($charset))
290 0 25 unless scalar @$flat
302 4371 79 if $$flat[$i][1] ne $tagname
303 4 75 if $$flat[$i][0]
305 26 49 unless wantarray
308 0 9 unless wantarray
320 2341 2965 if $$flat[$i][0]
323 2330 635 unless exists $$attr{$key}
324 550 85 if $$attr{$key} ne $val
325 28 57 unless wantarray
328 0 6 unless wantarray
381 10 96 unless exists $$attr{$name}
389 7 36 if defined $$elem[5]
390 0 36 if $$elem[0]
391 0 36 if defined $$elem[2] and $$elem[2] =~ m[/$]
410 0 0 if $$elem[0]
429 0 4 if $$elem[0]
432 0 4 unless $next_s
433 2 2 if $$next_s[0]
442 0 1 if $$elem[0]
444 0 1 if $closing <= $cur + 1
453 0 1 unless $child
465 0 0 unless $$c[0]
483 2 14 if ($$flat[$idx][0] and defined $$flat[$idx][6])
490 2 12 if defined $closing and $closing == $cur || $closing == $cur - 1
502 3 5 if $$flat[$cur][7]
515 1 4 if $parent < 0
516 0 4 if HTML::TagParser::Util::find_closing($flat, $parent) <= $cur
530 1405 1666 if ref $$elem[4]
531 855 811 unless defined $$elem[2]
540 1719 275 if ($test) { }
560 187 1568 unless defined $str
571 0 13 unless open $fh, $file
595 46 3868 if defined $4
611 15 44 if $$flat[$cur][6]
612 1 43 if ($$flat[$cur][2] || '') =~ m[/$]
621 3040 278 unless $$e[1] eq $name
622 0 278 if ($$e[2] || '') =~ m[/$]
623 115 163 $$e[0] ? :
624 1 277 if $pre_nest < 0
625 9 269 if not $$e[0] and $$e[6]
635 2481 45 unless $$e[1] eq $name
637 0 45 if ($$e[2] || '') =~ m[/$]
638 39 6 $$e[0] ? :
639 6 39 if $post_nest < 0
640 38 7 if $pre_nest <= $post_nest
641 0 7 if $$e[0] and defined $$e[6]
649 299 17 unless $$e[1] eq $name
650 3 14 if ($$e[2] || '') =~ m[/$]
651 9 5 $$e[0] ? :
652 6 8 if ($nest <= 0)
654 0 6 unless $$e[0]
658 3 5 if not $$e[0] and $$e[6]
671 12 0 if $args =~ m[ charset=['"]?([^'"\s/]+) ]gisx
678 0 11 if $from eq ''
679 0 11 if $to eq ''
680 4 7 if uc $from eq uc $to