Branch Coverage

lib/HTML/Query.pm
Criterion Covered Total %
branch 106 126 84.1


line true false branch
62 2 167 if @_ == 1 and ref $_[0] eq 'ARRAY'
85 19 274 if (not ref $element) { }
274 0 elsif (blessed $element) { }
90 12 7 if (@_) { }
5 2 elsif (@elements) { }
107 272 2 if ($element->isa($element_class)) { }
2 0 elsif ($element->isa($class)) { }
122 5 162 defined $select ? :
133 2 129 unless defined $query and length $query
162 104 276 if ($query =~ / \G (\s+) /cgsx)
163 104 0 defined $1 ? :
168 6 98 if ($leading_whitespace and $comops and $query =~ / \G (\*) \s+ /cgx)
175 27 353 if ($query =~ / \G (>|\+) \s* /cgx)
179 0 27 unless ($comops)
185 228 152 if ($query =~ / \G ([\w\*]+) /cgx)
188 18 210 if ($tag =~ /\*/) { }
189 14 4 if ($leading_whitespace || $comops == 0 and $tag eq '*') { }
193 7 7 if ($comops == 0)
206 1 209 if ($comops == 1 and $tag eq 'html')
217 39 489 if ($query =~ / \G \# ([\w\-]+) /cgx)
223 73 455 if ($query =~ / \G \. ([\w\-]+) /cgx)
229 47 481 if ($query =~ / \G \[ (.*?) \] /cgx)
234 38 9 if ($attribute =~ /(.*?)\s*([\|\~]?=)\s*(.*)/) { }
237 0 38 unless (defined $name and length $name)
243 38 0 if (defined $value) { }
248 33 5 if ($attribute_op eq '=') { }
2 3 elsif ($attribute_op eq '|=') { }
3 0 elsif ($attribute_op eq '~=') { }
266 2 7 unless (defined $attribute and length $attribute)
275 7 519 if ($query =~ / \G : :? ([\w\-]+) /cgx)
279 4 3 if ($pseudoclass eq 'first-child') { }
3 0 elsif ($pseudoclass eq 'last-child') { }
290 374 152 unless scalar @args > $work
295 130 244 unless @args
303 1 243 if ($hack_sequence == 2) { }
210 33 elsif (not $relationship) { }
16 17 elsif ($relationship eq '>') { }
11 6 elsif ($relationship eq '+') { }
6 0 elsif ($relationship eq '*') { }
308 2 208 if ($$self{'match_self'}) { }
318 110 143 if ($e->root == $e) { }
353 211 69 unless ref $sibling
384 129 1 if ($comops) { }
410 123 7 unless $query =~ / \G \s*,\s* /cgsx
414 0 123 if ($query =~ / \G (.+?) \s* $ /cgsx)
419 1 122 unless ($ops)
423 4 118 wantarray ? :
430 0 334 wantarray ? :
463 24 0 unless (exists $$self{'specificity'}{$selector})
477 2 9 if (defined $setting)
492 0 0 wantarray ? :
503 6 0 @{$self->get_elements;} ? :
509 4 0 @{$self->get_elements;} ? :
529 6 1 if ($self->suppress_errors) { }
530 6 0 if (defined $message)
555 830 95 unless (exists $seen{$item})
573 53 188 scalar @a > scalar @b ? :
577 0 1098 if (not defined $a[$index] || defined $b[$index]) { }
49 1049 elsif (not defined $a[$index]) { }
26 1023 elsif (not defined $b[$index]) { }
587 863 160 if ($a[$index] == $b[$index]) { }
610 0 76 if $method eq 'DESTROY'
618 76 0 wantarray ? :