Branch Coverage

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


line true false branch
47 0 251 if @_ < 1
51 7 244 if (@rules and ref $rules[0] eq "HASH")
53 0 7 if exists $opt{'keep_doctype'}
54 3 4 if exists $opt{'keep_comments_re'}
55 4 3 if exists $opt{'dummy_marker_re'}
56 0 7 if keys %opt
63 0 1 if @_ < 2
0 1 if @_ > 2
67 0 4 if @_ < 2
0 4 if @_ > 2
71 0 5 if @_ < 2
0 5 if @_ > 2
75 0 306 if @_ < 1
0 306 if @_ > 1
85 0 20 $n > 1114111 ? :
90 0 20 if @_ < 1
0 20 if @_ > 1
91 15 5 if ($str =~ s/\A"//u) { }
92 0 15 unless $str =~ s/"\z//u
94 0 5 unless $str =~ s/\A'//u
95 0 5 unless $str =~ s/'\z//u
107 0 6 if (defined $3) { }
109 0 4 $n > 1114111 ? :
149 0 606 if @_ < 3
0 606 if @_ > 1 and (@_ - 1) % 2
606 0 exists ${__rest}{'allow_tag_name'} ? :
0 606 if keys %{__rest}
150 160 446 if ($allow_tag_name and $$src_ref =~ /\G(\*|$ident)/cgu)
154 60 386 if ($$src_ref =~ /\G#($nmchar++)/cgu)
158 35 351 if ($$src_ref =~ /\G\.($ident)/cgu)
162 40 311 if ($$src_ref =~ / \G \[ $ws*+ ($ident) $ws*+ (?: ( [\^\$\*~\|]?+ ) = $ws*+ (?: ($ident) | ($string) ) $ws*+ )?+ \] /cgux)
176 9 31 unless (defined $op)
180 11 20 defined $val_ident ? :
181 4 27 if ($op eq "~" and $value eq '' || $value =~ /$ws/u or $op =~ /\A[\^\$*]\z/u and $value eq "")
190 17 294 if ($$src_ref =~ /\G:(nth-child|nth-of-type())\(/aacgi)
193 8 9 defined $2 ? :
195 0 17 unless $$src_ref =~ / \G ( ( [\-+]? [0-9]* ) [Nn] (?: $ws*+ ([\-+]) $ws*+ ([0-9]+) )?+ | [\-+]? [0-9]+ | [Oo][Dd][Dd] | [Ee][Vv][Ee][Nn] ) /cgux
210 0 17 unless $$src_ref =~ /\G\)/cgu
213 11 6 if (defined $num1) { }
2 4 elsif (lc $arg eq 'odd') { }
2 2 elsif (lc $arg eq 'even') { }
214 2 9 if ($num1 eq '+' or $num1 eq '') { }
3 6 elsif ($num1 eq '-') { }
221 11 0 if (defined $sign) { }
223 2 9 if $sign eq "-"
240 2 292 if ($$src_ref =~ /\G:first-child(?![^.#:\[\]),>~ \t\r\n\f])/aacgi)
244 2 290 if ($$src_ref =~ /\G:first-of-type(?![^.#:\[\]),>~ \t\r\n\f])/aacgi)
248 0 290 if ($$src_ref =~ /\G:($ident)/cgu)
255 0 256 if @_ < 1
0 256 if @_ > 1
256 0 256 if ref $src
266 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) { }
269 0 5 unless my $simple = _try_parse_simple_selector(\$src, "allow_tag_name", 1)
272 0 5 unless $src =~ /\G\)/cgu
280 0 33 unless @$simples
288 0 1 unless @$simples
302 0 256 unless $src =~ /\G$ws*+\z/u
304 0 0 @alternatives ? :
0 0 @$sequences ? :
0 256 unless @$simples
318 0 132 if @_ < 1
0 132 if @_ > 1
322 0 82 if @_ < 2
0 82 if @_ > 2
323 0 82 unless $var =~ /\A[^\W\d][\w\-.]*\z/u
327 0 41 if @_ < 2
0 41 if @_ > 2
331 0 30 if @_ < 1
0 30 if @_ > 1
332 0 30 unless ref $val eq "CODE"
336 0 7 if @_ < 2
0 7 if @_ > 2
337 0 7 unless builtin::blessed($val) and $val->isa("HTML::Blitz::Template")
342 0 5 if @_ < 2
0 5 if @_ > 2
356 0 33 if @_ < 1
0 33 if @_ > 1
358 0 17 if @_ < 2
0 17 if @_ > 2
373 0 6 if @_ < 2
375 0 14 if $word =~ /[ \t\r\n\f]/u
378 0 30 if @_ < 1
0 30 if @_ > 1
381 35 6 unless $seen{$word}++
387 0 6 if @_ < 2
390 0 22 if $word =~ /[ \t\r\n\f]/u
394 0 6 if @_ < 1
0 6 if @_ > 1
397 2 4 length $new_value ? :
688 0 259 if @_ < 2
0 259 if @_ > 3
1 258 if @_ < 3
689 0 259 unless ref $action_proto eq "ARRAY"
691 0 259 unless @$action_proto
694 0 0 $type eq 'seperator' && $custom_action->{'separator'} ? :
695 0 0 if @_ < 1
0 0 if @_ > 1
698 0 256 if @_ < 1
0 256 if @_ > 1 and (@_ - 1) % 2
6 250 exists ${__rest}{'custom_action'} ? :
0 256 if keys %{__rest}
701 0 0 if @_ < 1
0 0 if @_ > 1
705 0 253 if @_ < 1
709 249 0 if @$actions
714 0 276 if @_ < 3
0 276 if @_ > 3
718 0 10 if @_ < 2
0 10 if @_ > 2
720 0 10 unless open my $fh, "<:encoding(UTF-8)", $file