Branch Coverage

blib/lib/Mojo/DOM/HTML.pm
Criterion Covered Total %
branch 88 90 97.7


line true false branch
107 21 9438 if defined $runaway
108 2593 6866 if defined $text
111 3206 6253 if (defined $tag) { }
17 6236 elsif (defined $doctype) { }
13 6223 elsif (defined $comment) { }
7 6216 elsif (defined $cdata) { }
18 6198 elsif (defined $pi) { }
114 1394 1812 if ($tag =~ m[^/\s*(\S+)]u) { }
1812 0 elsif ($tag =~ m[^([^\s/]+)([\s\S]*)]u) { }
115 93 1301 $xml ? :
118 15 1379 if (not $xml and my $tags = $NO_MORE_CONTENT{$end})
125 112 1700 $xml ? :
130 47 33895 $xml ? :
133 52 33890 if $key eq "/"
135 33862 28 defined $value ? :
139 1 1811 if not $xml and $start eq "image"
143 151 1661 if not $xml and $EMPTY{$start} or $xml || !$BLOCK{$start} and $closing
146 1750 62 if $xml or not $RAW{$start} || $RCDATA{$start}
147 1 61 unless $html =~ m[\G(.*?))]cgisu
148 32 29 $RCDATA{$start} ? :
164 11 7 if not exists $self->{'xml'} and $pi =~ /xml/iu
186 420 4002 if $next->[0] eq "root"
189 3 3999 if $SCOPE{$next->[1]} and $next->[1] ne $end
192 1662 2337 if $next->[1] eq $end
195 6 2312 if not $xml and $PHRASING{$end} and not $PHRASING{$next->[1]}
211 1330 1065 if ($type eq "tag")
220 2 35 $xml ? :
37 1491 unless defined $value
225 406 25 $EMPTY{$tag} ? :
5 431 $xml ? :
436 894 unless $tree->[4]
236 545 520 if $type eq "text"
239 370 150 if $type eq "raw"
242 136 14 if $type eq "root"
245 4 10 if $type eq "doctype"
248 4 6 if $type eq "comment"
251 3 3 if $type eq "cdata"
254 3 0 if $type eq "pi"
264 1396 416 if (not $xml and $$current->[0] ne "root")
265 405 991 if (my $end = $END{$start}) { }
504 487 elsif (my $close = $CLOSE{$start}) { }
273 50 327 if $$allowed{$parent->[1]}
289 366 125 ref $_[-1] eq 'CODE' ? :
491 397 if @_ % 2
293 883 5 unless exists $attrs->{'data'} and ref $attrs->{'data'} eq "HASH"