Branch Coverage

lib/XML/DOM/Lite/XPath.pm
Criterion Covered Total %
branch 115 290 39.6


line true false branch
11 60 3 $parent ? :
23 49 11 defined $node ? :
34 26 defined $position ? :
32 28 defined $nodelist ? :
37 0 0 if (defined $$self{'variables'}{'name'}) { }
0 0 elsif ($$self{'parent'}) { }
97 0 0 $_[0]{'value'} ? :
139 0 1 if (@{$_[0]{'value'};} == 0) { }
189 4 9 if ($$self{'absolute'}) { }
208 10 7 if ($step == @$steps - 1) { }
253 0 20 if ($$self{'axis'} eq $$xpathAxis{'ANCESTOR_OR_SELF'}) { }
0 20 elsif ($$self{'axis'} eq $$xpathAxis{'ANCESTOR'}) { }
2 18 elsif ($$self{'axis'} eq $$xpathAxis{'ATTRIBUTE'}) { }
14 4 elsif ($$self{'axis'} eq $$xpathAxis{'CHILD'}) { }
1 3 elsif ($$self{'axis'} eq $$xpathAxis{'DESCENDANT_OR_SELF'}) { }
0 3 elsif ($$self{'axis'} eq $$xpathAxis{'DESCENDANT'}) { }
0 3 elsif ($$self{'axis'} eq $$xpathAxis{'FOLLOWING'}) { }
0 3 elsif ($$self{'axis'} eq $$xpathAxis{'FOLLOWING_SIBLING'}) { }
0 3 elsif ($$self{'axis'} eq $$xpathAxis{'NAMESPACE'}) { }
0 3 elsif ($$self{'axis'} eq $$xpathAxis{'PARENT'}) { }
0 3 elsif ($$self{'axis'} eq $$xpathAxis{'PRECEDING'}) { }
0 3 elsif ($$self{'axis'} eq $$xpathAxis{'PRECEDING_SIBLING'}) { }
3 0 elsif ($$self{'axis'} eq $$xpathAxis{'SELF'}) { }
294 0 0 if ($input->parentNode)
322 17 5 if ($$self{'nodetest'}->evaluate($ctx->clone($n, $i, $nodelist0))->booleanValue)
332 2 0 if ($$self{'predicate'}[$i]->evaluate($ctx->clone($n, $ii, $nodelist0))->booleanValue)
431 0 2 if ($$v{'type'} eq 'number') { }
454 0 0 if ($f) { }
466 0 0 unless $b
496 0 0 if ($$e{'type'} eq 'node-set') { }
508 0 0 if ($n)
527 0 0 if (@{$$self{'args'};} == 0) { }
533 0 0 if (@$n == 0) { }
543 0 0 if (@{$$self{'args'};} == 0) { }
582 0 0 if ($i == -1) { }
597 0 0 if ($i == -1) { }
611 0 0 if (@{$$self{'args'};} == 2) { }
612 0 0 0 <=> round($s1 - 1) ? :
618 0 0 0 <=> $i0 ? :
619 0 0 round('%d', $s2) - (0 <=> -$i0) ? :
628 0 0 if (@{$$self{'args'};} > 0) { }
639 0 0 if (@{$$self{'args'};} > 0) { }
698 0 0 if ($xmllang)
703 0 0 if (not $xmllang) { }
715 0 0 if (@{$$self{'args'};} == 1) { }
761 0 0 if ($ret)
772 0 0 if ($$self{'args'}[0]->evaluate($ctx)->booleanValue) { }
815 0 0 if ($$nodes1[$i1] == $$nodes2[$i2])
855 0 0 if ($$self{'predicate'}[$i]->evaluate($ctx->clone($n, $j, $nodes0))->booleanValue)
885 0 2 if ($o eq 'or') { }
0 2 elsif ($o eq 'and') { }
0 2 elsif ($o eq '+') { }
0 2 elsif ($o eq '-') { }
0 2 elsif ($o eq '*') { }
0 2 elsif ($o eq 'mod') { }
0 2 elsif ($o eq 'div') { }
2 0 elsif ($o eq '=') { }
0 0 elsif ($o eq '!=') { }
0 0 elsif ($o eq '<') { }
0 0 elsif ($o eq '<=') { }
0 0 elsif ($o eq '>') { }
0 0 elsif ($o eq '>=') { }
930 0 2 if ($$v1{'type'} eq 'node-set' and $$v2{'type'} eq 'node-set') { }
2 0 elsif ($$v1{'type'} eq 'node-set' or $$v2{'type'} eq 'node-set') { }
0 0 elsif ($$v1{'type'} eq 'boolean' or $$v2{'type'} eq 'boolean') { }
0 0 elsif ($$v1{'type'} eq 'number' or $$v2{'type'} eq 'number') { }
936 0 0 if (XML::DOM::Lite::XPath::xmlValue($$n1[$i1]) cmp XML::DOM::Lite::XPath::xmlValue($$n2[$i2]))
946 0 2 if ($$v1{'type'} eq 'number') { }
0 2 elsif ($$v2{'type'} eq 'number') { }
0 2 elsif ($$v1{'type'} eq 'string') { }
2 0 elsif ($$v2{'type'} eq 'string') { }
953 0 0 if ($s cmp $nn)
966 0 0 if ($nn cmp $s)
979 0 0 if ($s cmp $nn)
992 2 0 if ($nn cmp $s)
1078 2 0 if ($ctx->nodeType)
1087 0 9 if $DEBUG
1091 4 5 if ($cached)
1092 0 4 if $DEBUG
1095 0 5 if ($expr =~ /^(\$|@)?\w+$/i)
1098 0 0 if $DEBUG
1102 1 4 if ($expr =~ m[^\w+(/\w+)*$]i)
1105 0 1 if $DEBUG
1131 18 421 if (@result and length $result[0] > length $match)
1138 0 0 if ($rule and $rule == $TOK_DIV || $rule == $TOK_MOD || $rule == $TOK_AND || $rule == $TOK_OR and !$previous || $$previous{'tag'} == $TOK_AT || $$previous{'tag'} == $TOK_DSLASH || $$previous{'tag'} == $TOK_SLASH || $$previous{'tag'} == $TOK_AXIS || $$previous{'tag'} == $TOK_DOLLAR)
1152 18 4 if ($rule) { }
1154 0 18 if $DEBUG
1155 12 6 $$rule{'prec'} ? :
1163 0 4 if $DEBUG
1169 0 59 if $DEBUG
1173 0 4 if $DEBUG
1175 0 4 if (@$stack != 1)
1182 0 4 if $DEBUG
1196 77 4 if (@$stack)
1199 71 6 if ($ruleset)
1202 63 175 if (@$match)
1216 59 22 if ($cand and !$ahead || $$cand{'prec'} > $$ahead{'prec'} || $$ahead{'tag'}{'left'} && $$cand{'prec'} >= $$ahead{'prec'}) { }
1222 0 0 $$ahead{'tag'}{'left'} ? :
0 0 $ahead ? :
0 59 if $DEBUG
1236 18 4 if ($ahead)
1237 0 0 $$ahead{'tag'}{'left'} ? :
0 0 $cand ? :
0 18 if $DEBUG
1260 4 355 if ($$pattern[$p] == $Q_MM) { }
0 355 elsif ($$pattern[$p] == $Q_01) { }
0 355 elsif ($$pattern[$p] == $Q_1M) { }
256 99 elsif ($$stack[$s]{'tag'} == $$pattern[$p]) { }
1281 0 0 if ($$stack[$s]{'tag'} == $$pattern[$p]) { }
1306 63 76 if ($p == -1) { }
1323 63 0 if ($$frame{'rule'}) { }
0 0 elsif ($$frame{'tag'}) { }
0 0 elsif (ref $frame eq 'ARRAY' and @$frame) { }
1324 59 4 if (@{$$frame{'rule'};} >= 3 and $$frame{'rule'}[2] >= 0) { }
1346 2 6 if ($_[0] > $_[1]) { }
1352 0 0 if ($ret)
1450 1 2 if ($abbrev eq '//') { }
2 0 elsif ($abbrev eq '.') { }
0 0 elsif ($abbrev eq '..') { }
1477 0 0 if ($type eq 'node') { }
0 0 elsif ($type eq 'text') { }
0 0 elsif ($type eq 'comment') { }
0 0 elsif ($type eq 'processing-instruction') { }
1491 0 0 if ($type ne 'processing-instruction')
1545 0 2 if (@$predicates > 0) { }
1580 0 0 if (substr($expr, 0, 1) eq '$') { }
0 0 elsif (substr($expr, 0, 1) eq '@') { }
0 0 elsif ($expr =~ /^[0-9]+$/) { }
1915 6 3 if (@$xpathRules)
1931 0 3 if $DEBUG
1935 78 93 unless $$array[$position]
1944 0 171 if ($$pattern[$j] == $Q_1M) { }
3 168 elsif ($$pattern[$j] == $Q_MM or $$pattern[$j] == $Q_01) { }
1959 0 3 if $DEBUG
1962 78 72 if ($_)
1964 0 3 if $DEBUG
1993 2 0 unless @$sort
2007 0 0 if ($$s{'type'} eq 'text') { }
0 0 elsif ($$s{'type'} eq 'number') { }
2033 0 0 $$v1{'key'}[$i]{'order'} eq 'descending' ? :
2034 0 0 if ($$v1{'key'}[$i]{'value'} > $$v2{'key'}[$i]{'value'}) { }
0 0 elsif ($$v1{'key'}[$i]{'value'} < $$v2{'key'}[$i]{'value'}) { }
2046 0 4 unless $node
2049 3 1 if ($$node{'nodeType'} == 3 or $$node{'nodeType'} == 4 or $$node{'nodeType'} == 2) { }
1 0 elsif ($$node{'nodeType'} == 1 or $$node{'nodeType'} == 9 or $$node{'nodeType'} == 11) { }