Branch Coverage

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


line true false branch
25 0 27 if @_ < 2
0 27 if @_ > 2 and (@_ - 2) % 2
19 8 exists ${__rest}{'pos'} ? :
17 10 exists ${__rest}{'width'} ? :
6 21 exists ${__rest}{'alt_width'} ? :
0 27 if keys %{__rest}
38 0 10 if @_ < 3
0 10 if @_ > 3
45 7 3 $type eq ':TT-TAG-OPEN' || $type eq ':TT-TAG-CLOSE' ? :
49 0 273 if @_ < 3
0 273 if @_ > 3
58 0 273 if $src =~ /([\x{d800}-\x{dfff}])/u
60 0 273 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
80 0 273 if $src =~ /((?![ \t\n\f])[\x00-\x1f\x7f-\x9f])/u
124 0 3599 if @_ < 2
0 3599 if @_ > 2
125 3437 162 unless $chunk eq "&"
130 30 132 if ($$src_ref =~ /\G#/cgu) { }
131 18 12 if ($$src_ref =~ /\G[xX]/cgu) { }
132 0 18 unless $$src_ref =~ /\G([[:xdigit:]]+)/cgu
136 0 12 unless $$src_ref =~ /\G(\d+)/acg
141 0 132 unless $$src_ref =~ /\G(\w+)/acg
146 0 162 unless $$src_ref =~ /\G;/cgu
152 0 2148 if @_ < 1
0 2148 if @_ > 1
154 1451 697 @$tag_stack ? :
157 0 5584 if @_ < 1
0 5584 if @_ > 1
161 3776 1808 @$tag_stack ? :
163 236 5348 if ($$src_ref =~ /\G\z/u)
164 0 236 if length $cur_tag
174 200 5148 if ($cur_tag eq 'script') { }
140 5008 elsif ($cur_tag eq 'style') { }
186 4822 elsif ($cur_tag eq 'title') { }
0 4822 elsif ($cur_tag eq 'textarea') { }
175 0 1 if @_ > 0
177 0 205 unless $$src_ref =~ m[ ( ) | < (/?) script [ \t\n\f/>] ]aacgix
183 2 9 if ($1)
186 6 3 unless ($2)
187 0 6 unless $$src_ref =~ m[ (-->) | ] ]aacgix
188 3 3 if ($1)
199 70 70 if ($$src_ref =~ m[\G ( (?: (?! ] ) . )+ ) ]cgsux)
216 2388 2959 if (length $text)
225 2959 0 if ($$src_ref =~ /\G
226 54 2905 if ($$src_ref =~ /\G!/cgu)
227 43 11 if ($$src_ref =~ /\G--/cgu)
228 2 41 if ($$src_ref =~ /\G(-?>)/u)
231 1 40 unless $$src_ref =~ /\G(.*?)(?|--!?>)/cgsu
234 1 39 if ($closer eq "")
254 2 36 if ($closer eq "")
265 9 2 if ($$src_ref =~ /\Gdoctype/aacgi)
266 0 9 unless $$src_ref =~ /\G[ \t\n\f]+/cgu
268 0 9 unless $$src_ref =~ /\Ghtml/aacgi
270 0 9 unless $$src_ref =~ /\G[ \t\n\f]*>/cgu
278 1 1 if ($self->{'in_foreign_elem'} and $$src_ref =~ /\G\[CDATA\[/cgu)
280 0 1 unless $$src_ref =~ /\]\]>/cgu
294 0 2905 unless $$src_ref =~ m[\G([a-zA-Z][^\s/>[:cntrl:]]*)]cgu
303 1 1096 if ($closing)
308 1 1095 if (exists $attrs{$attr_name})
315 1088 7 if ($$src_ref =~ /\G=[ \t\n\f]*/cgu)
316 332 756 if ($$src_ref =~ /\G"/cgu) { }
8 748 elsif ($$src_ref =~ /\G'/cgu) { }
747 1 elsif ($$src_ref =~ /\G ( [^ \t\n\f&>"'<=`]+ | & )/cgux) { }
322 0 332 unless $$src_ref =~ /\G"/cgu
324 0 332 if $$src_ref =~ m[\G[^ \t\n\f/>]]u
333 1 7 unless $$src_ref =~ /\G'/cgu
335 1 6 if $$src_ref =~ m[\G[^ \t\n\f/>]]u
355 2 2898 unless $$src_ref =~ m[\G(/?)>]cgu
359 1340 1558 if ($closing)
360 0 1340 if $is_self_closing
361 2 1338 unless @$tag_stack
364 0 1338 unless $cur_tag eq $name
367 2 1336 if ($foreign_tags{$cur_tag})
379 1 3 if ($is_self_closing and not $is_void and not $foreign_tags{$name} and not $self->{'in_foreign_elem'})
384 1366 191 unless ($is_self_closing)
386 2 1364 if ($foreign_tags{$name})