Branch Coverage

blib/lib/HTML/Blitz.pm
Criterion Covered Total %
branch 135 226 59.7


line true false branch
49 0 251 if @_ < 1
53 7 244 if (@rules and ref $rules[0] eq "HASH")
55 0 7 if exists $opt{'keep_doctype'}
56 3 4 if exists $opt{'keep_comments_re'}
57 4 3 if exists $opt{'dummy_marker_re'}
58 0 7 if keys %opt
65 0 1 if @_ < 2
0 1 if @_ > 2
69 0 4 if @_ < 2
0 4 if @_ > 2
73 0 5 if @_ < 2
0 5 if @_ > 2
77 0 306 if @_ < 1
0 306 if @_ > 1
87 0 20 $n > 1114111 ? :
92 0 20 if @_ < 1
0 20 if @_ > 1
93 15 5 if ($str =~ s/\A"//u) { }
94 0 15 unless $str =~ s/"\z//u
96 0 5 unless $str =~ s/\A'//u
97 0 5 unless $str =~ s/'\z//u
109 0 6 defined $3 ? :
111 0 4 $n > 1114111 ? :
151 0 606 if @_ < 3
0 606 if @_ > 1 and (@_ - 1) % 2
606 0 exists ${__rest}{'allow_tag_name'} ? :
0 606 if keys %{__rest}
152 160 446 if ($allow_tag_name and $$src_ref =~ /\G(\*|$ident)/cgu)
156 60 386 if ($$src_ref =~ /\G#($nmchar++)/cgu)
160 35 351 if ($$src_ref =~ /\G\.($ident)/cgu)
164 40 311 if ($$src_ref =~ / \G \[ $ws*+ ($ident) $ws*+ (?: ( [\^\$\*~\|]?+ ) = $ws*+ (?: ($ident) | ($string) ) $ws*+ )?+ \] /cgux)
178 9 31 unless (defined $op)
182 11 20 defined $val_ident ? :
183 4 27 if ($op eq "~" and $value eq '' || $value =~ /$ws/u or $op =~ /\A[\^\$*]\z/u and $value eq "")
192 17 294 if ($$src_ref =~ /\G:(nth-child|nth-of-type())\(/aacgi)
195 8 9 defined $2 ? :
197 0 17 unless $$src_ref =~ / \G ( ( [\-+]? [0-9]* ) [Nn] (?: $ws*+ ([\-+]) $ws*+ ([0-9]+) )?+ | [\-+]? [0-9]+ | [Oo][Dd][Dd] | [Ee][Vv][Ee][Nn] ) /cgux
212 0 17 unless $$src_ref =~ /\G\)/cgu
215 11 6 if (defined $num1) { }
2 4 elsif (lc $arg eq 'odd') { }
2 2 elsif (lc $arg eq 'even') { }
216 2 9 if ($num1 eq '+' or $num1 eq '') { }
3 6 elsif ($num1 eq '-') { }
223 11 0 if (defined $sign) { }
225 2 9 if $sign eq "-"
242 2 292 if ($$src_ref =~ /\G:first-child(?![^.#:\[\]),>~ \t\r\n\f])/aacgi)
246 2 290 if ($$src_ref =~ /\G:first-of-type(?![^.#:\[\]),>~ \t\r\n\f])/aacgi)
250 0 290 if ($$src_ref =~ /\G:($ident)/cgu)
257 0 256 if @_ < 1
0 256 if @_ > 1
258 0 256 if ref $src
268 5 601 if ($src =~ /\G:not\(/aacgi) { }
311 290 elsif (defined(my $simple = _try_parse_simple_selector(\$src, 'allow_tag_name', !@$simples))) { }
33 257 elsif ($src =~ /\G(?>$ws*([>~+])|$ws)$ws*+/cgu) { }
1 256 elsif ($src =~ /\G,$ws*+/cgu) { }
271 0 5 unless my $simple = _try_parse_simple_selector(\$src, "allow_tag_name", 1)
274 0 5 unless $src =~ /\G\)/cgu
282 0 33 unless @$simples
290 0 1 unless @$simples
304 0 256 unless $src =~ /\G$ws*+\z/u
306 0 0 @alternatives ? :
0 0 @$sequences ? :
0 256 unless @$simples
320 0 132 if @_ < 1
0 132 if @_ > 1
324 0 82 if @_ < 2
0 82 if @_ > 2
325 0 82 unless $var =~ /\A[^\W\d][\w\-.]*\z/u
329 0 41 if @_ < 2
0 41 if @_ > 2
333 0 30 if @_ < 1
0 30 if @_ > 1
334 0 30 unless ref $val eq "CODE"
338 0 7 if @_ < 2
0 7 if @_ > 2
339 0 7 unless &blessed($val) and $val->isa("HTML::Blitz::Template")
344 0 5 if @_ < 2
0 5 if @_ > 2
358 0 33 if @_ < 1
0 33 if @_ > 1
360 0 17 if @_ < 2
0 17 if @_ > 2
375 0 6 if @_ < 2
377 0 14 if $word =~ /[ \t\r\n\f]/u
380 0 30 if @_ < 1
0 30 if @_ > 1
383 35 6 unless $seen{$word}++
389 0 6 if @_ < 2
392 0 22 if $word =~ /[ \t\r\n\f]/u
396 0 6 if @_ < 1
0 6 if @_ > 1
399 2 4 length $new_value ? :
690 0 259 if @_ < 2
0 259 if @_ > 3
1 258 if @_ < 3
691 0 259 unless ref $action_proto eq "ARRAY"
693 0 259 unless @$action_proto
696 0 0 $type eq 'seperator' && $custom_action->{'separator'} ? :
697 0 0 if @_ < 1
0 0 if @_ > 1
700 0 256 if @_ < 1
0 256 if @_ > 1 and (@_ - 1) % 2
6 250 exists ${__rest}{'custom_action'} ? :
0 256 if keys %{__rest}
703 0 0 if @_ < 1
0 0 if @_ > 1
707 0 253 if @_ < 1
711 249 0 if @$actions
716 0 276 if @_ < 3
0 276 if @_ > 3
720 0 10 if @_ < 2
0 10 if @_ > 2
722 0 10 unless open my $fh, "<:encoding(UTF-8)", $file