Branch Coverage

blib/lib/HTML/Blitz/Parser.pm
Criterion Covered Total %
branch 123 158 77.8


line true false branch
23 0 28 if @_ < 2
0 28 if @_ > 2 and (@_ - 2) % 2
20 8 exists ${__rest}{'pos'} ? :
18 10 exists ${__rest}{'width'} ? :
6 22 exists ${__rest}{'alt_width'} ? :
0 28 if keys %{__rest}
36 0 11 if @_ < 3
0 11 if @_ > 3
43 8 3 $type eq ':TT-TAG-OPEN' || $type eq ':TT-TAG-CLOSE' ? :
47 0 276 if @_ < 3
0 276 if @_ > 3
56 0 276 if $src =~ /([\x{d800}-\x{dfff}])/u
58 0 276 if $src =~ /( [\x{fdd0}-\x{fdef}] | [\x{fffe}\x{ffff}] | [\x{1fffe}\x{1ffff}] | [\x{2fffe}\x{2ffff}] | [\x{3fffe}\x{3ffff}] | [\x{4fffe}\x{4ffff}] | [\x{5fffe}\x{5ffff}] | [\x{6fffe}\x{6ffff}] | [\x{7fffe}\x{7ffff}] | [\x{8fffe}\x{8ffff}] | [\x{9fffe}\x{9ffff}] | [\x{afffe}\x{affff}] | [\x{bfffe}\x{bffff}] | [\x{cfffe}\x{cffff}] | [\x{dfffe}\x{dffff}] | [\x{efffe}\x{effff}] | [\x{ffffe}\x{fffff}] | [\x{10fffe}\x{10ffff}] )/ux
78 0 276 if $src =~ /((?![ \t\n\f])[\x00-\x1f\x7f-\x9f])/u
122 0 3640 if @_ < 2
0 3640 if @_ > 2
123 3477 163 unless $chunk eq "&"
128 30 133 if ($$src_ref =~ /\G#/cgu) { }
129 18 12 if ($$src_ref =~ /\G[xX]/cgu) { }
130 0 18 unless $$src_ref =~ /\G([[:xdigit:]]+)/cgu
134 0 12 unless $$src_ref =~ /\G(\d+)/acg
139 0 133 unless $$src_ref =~ /\G(\w+)/acg
144 0 163 unless $$src_ref =~ /\G;/cgu
150 0 2172 if @_ < 1
0 2172 if @_ > 1
152 1469 703 @$tag_stack ? :
155 0 5653 if @_ < 1
0 5653 if @_ > 1
159 3828 1825 @$tag_stack ? :
161 238 5415 if ($$src_ref =~ /\G\z/u)
162 0 238 if length $cur_tag
172 202 5213 if ($cur_tag eq 'script') { }
140 5073 elsif ($cur_tag eq 'style') { }
188 4885 elsif ($cur_tag eq 'title') { }
0 4885 elsif ($cur_tag eq 'textarea') { }
173 0 1 if @_ > 0
175 0 207 unless $$src_ref =~ m[ ( ) | < (/?) script [ \t\n\f/>] ]aacgix
181 2 9 if ($1)
184 6 3 unless ($2)
185 0 6 unless $$src_ref =~ m[ (-->) | ] ]aacgix
186 3 3 if ($1)
197 70 70 if ($$src_ref =~ m[\G ( (?: (?! ] ) . )+ ) ]cgsux)
214 2415 2999 if (length $text)
223 2999 0 if ($$src_ref =~ /\G
224 59 2940 if ($$src_ref =~ /\G!/cgu)
225 47 12 if ($$src_ref =~ /\G--/cgu)
226 2 45 if ($$src_ref =~ /\G(-?>)/u)
229 1 44 unless $$src_ref =~ /\G(.*?)(?|--!?>)/cgsu
232 1 43 if ($closer eq "")
252 2 40 if ($closer eq "")
263 10 2 if ($$src_ref =~ /\Gdoctype/aacgi)
264 0 10 unless $$src_ref =~ /\G[ \t\n\f]+/cgu
266 0 10 unless $$src_ref =~ /\Ghtml/aacgi
268 0 10 unless $$src_ref =~ /\G[ \t\n\f]*>/cgu
276 1 1 if ($self->{'in_foreign_elem'} and $$src_ref =~ /\G\[CDATA\[/cgu)
278 0 1 unless $$src_ref =~ /\]\]>/cgu
292 0 2940 unless $$src_ref =~ m[\G([a-zA-Z][^\s/>[:cntrl:]]*)]cgu
301 1 1109 if ($closing)
306 1 1108 if (exists $attrs{$attr_name})
313 1101 7 if ($$src_ref =~ /\G=[ \t\n\f]*/cgu)
314 341 760 if ($$src_ref =~ /\G"/cgu) { }
8 752 elsif ($$src_ref =~ /\G'/cgu) { }
751 1 elsif ($$src_ref =~ /\G ( [^ \t\n\f&>"'<=`]+ | & )/cgux) { }
320 0 341 unless $$src_ref =~ /\G"/cgu
322 0 341 if $$src_ref =~ m[\G[^ \t\n\f/>]]u
331 1 7 unless $$src_ref =~ /\G'/cgu
333 1 6 if $$src_ref =~ m[\G[^ \t\n\f/>]]u
353 2 2933 unless $$src_ref =~ m[\G(/?)>]cgu
357 1354 1579 if ($closing)
358 0 1354 if $is_self_closing
359 2 1352 unless @$tag_stack
362 0 1352 unless $cur_tag eq $name
365 2 1350 if ($foreign_tags{$cur_tag})
377 1 3 if ($is_self_closing and not $is_void and not $foreign_tags{$name} and not $self->{'in_foreign_elem'})
382 1383 195 unless ($is_self_closing)
384 2 1381 if ($foreign_tags{$name})