Branch Coverage

blib/lib/XML/XPathEngine.pm
Criterion Covered Total %
branch 121 212 57.0


line true false branch
67 0 1 if $XML::XPathEngine::DEBUG
83 22 13 if ($results->isa('XML::XPathEngine::NodeSet')) { }
96 0 0 if (grep {"$node" eq "$_";} @nodes)
106 2 0 if ($results->isa('XML::XPathEngine::NodeSet')) { }
107 2 0 wantarray ? :
109 0 0 wantarray ? :
124 0 0 if ($results->isa('XML::XPathEngine::NodeSet')) { }
0 0 elsif ($results->isa('XML::XPathEngine::Boolean')) { }
0 0 elsif ($results->isa('XML::XPathEngine::Node')) { }
144 0 0 if ($results->isa('XML::XPathEngine::NodeSet')) { }
0 0 elsif ($results->isa('XML::XPathEngine::Boolean')) { }
0 0 elsif ($results->isa('XML::XPathEngine::Node')) { }
162 18 13 if ($results->isa('XML::XPathEngine::NodeSet'))
172 2 0 if ($results->isa('XML::XPathEngine::NodeSet'))
182 0 0 unless defined $self
184 0 0 scalar @nodeset ? :
217 0 0 $$self{'uses_namespaces'} ? :
0 0 $node ? :
242 4 34 if ($XML::XPathEngine::CACHE{$context})
249 0 34 if ($$self{'_tokpos'} < scalar @$tokens)
259 0 34 if $XML::XPathEngine::DEBUG
271 0 34 if $XML::XPathEngine::DEBUG
279 3 397 if ($expected eq 'RE' and $path =~ /\G\s*($XML::XPathEngine::REGEXP_RE $XML::XPathEngine::REGEXP_MOD_RE?)\s*/cgosx) { }
363 34 elsif ($path =~ m{\G \s* # ignore all whitespace ( # tokens $XML::XPathEngine::LITERAL| $XML::XPathEngine::NUMBER_RE| # digits \.\.| # parent \.| # current ($XML::XPathEngine::AXIS_NAME)?$XML::XPathEngine::NODE_TYPE| # tests processing-instruction| \@($XML::XPathEngine::NCWild|$XML::XPathEngine::QName|$XML::XPathEngine::QNWild)| # attrib \$$XML::XPathEngine::QName| # variable reference ($XML::XPathEngine::AXIS_NAME)?($XML::XPathEngine::NCWild|$XML::XPathEngine::QName|$XML::XPathEngine::QNWild)| # NCName,NodeType,Axis::Test \!=|<=|\-|>=|//|and|or|mod|div| # multi-char seps =~|\!~| # regexp (not in the XPath spec) [,\+=\|<>/\(\[\]\)]| # single char seps (?
307 3 360 $token =~ /^[=!]~$/ ? :
312 332 34 if (length $token)
313 0 332 if $XML::XPathEngine::DEBUG
319 0 34 if (pos $path < length $path)
345 341 1501 unless $$self{'_tokpos'} < @$tokens
351 269 1232 if ($$tokens[$$self{'_tokpos'}] =~ /^$match$/) { }
357 0 1232 if ($fatal) { }
369 0 88 if $XML::XPathEngine::DEBUG
377 0 88 if $XML::XPathEngine::DEBUG
397 0 89 if $XML::XPathEngine::DEBUG
417 0 91 if $XML::XPathEngine::DEBUG
439 0 94 if $XML::XPathEngine::DEBUG
459 0 112 if $XML::XPathEngine::DEBUG
479 0 113 if $XML::XPathEngine::DEBUG
499 0 113 if $XML::XPathEngine::DEBUG
519 0 113 if $XML::XPathEngine::DEBUG
521 0 113 if (_match($self, $tokens, '-')) { }
536 0 113 if $XML::XPathEngine::DEBUG
556 0 113 if $XML::XPathEngine::DEBUG
569 35 78 if ($test =~ m[^(//?|\.\.?)$]) { }
18 60 elsif (_is_step($self, $tokens)) { }
582 10 50 if (_match($self, $tokens, '//?'))
585 3 7 if ($$self{'_curr_match'} eq '//')
602 0 60 if $XML::XPathEngine::DEBUG
617 0 60 if $XML::XPathEngine::DEBUG
621 20 40 if (_match($self, $tokens, $XML::XPathEngine::LITERAL)) { }
3 37 elsif (_match($self, $tokens, "$XML::XPathEngine::REGEXP_RE$XML::XPathEngine::REGEXP_MOD_RE?")) { }
12 25 elsif (_match($self, $tokens, $XML::XPathEngine::NUMBER_RE)) { }
3 22 elsif (_match($self, $tokens, '\\(')) { }
0 22 elsif (_match($self, $tokens, "\\\$$XML::XPathEngine::QName")) { }
22 0 elsif (_match($self, $tokens, $XML::XPathEngine::QName)) { }
631 0 3 if ($mod)
671 0 22 if $XML::XPathEngine::DEBUG
675 0 22 if ($$tokens[$$self{'_tokpos'}] eq ')')
690 0 53 if $XML::XPathEngine::DEBUG
694 5 48 if (_match($self, $tokens, '/')) { }
22 26 elsif (_match($self, $tokens, '//')) { }
696 0 5 if $XML::XPathEngine::DEBUG
698 5 0 if (_is_step($self, $tokens))
699 0 5 if $XML::XPathEngine::DEBUG
707 16 6 if (not $optimised) { }
726 0 29 if $XML::XPathEngine::DEBUG
731 15 14 if ($$tokens[$tokpos + 1] and $$tokens[$tokpos + 1] eq '[') { }
0 14 elsif ($$tokens[$tokpos] =~ /^\.\.?$/) { }
740 0 14 if $XML::XPathEngine::DEBUG
742 1 13 if ($$step{'axis'} ne 'child')
758 0 63 if $XML::XPathEngine::DEBUG
764 7 15 if ($$self{'_curr_match'} eq '//')
766 0 7 if (not $optimised) { }
775 7 15 if (@steps > 1 and $steps[-1]{'axis'} eq 'self' and $steps[-1]{'test'} == 9)
788 0 99 if $XML::XPathEngine::DEBUG
790 21 78 if (_match($self, $tokens, '\\.')) { }
1 77 elsif (_match($self, $tokens, '\\.\\.')) { }
802 0 77 if $XML::XPathEngine::DEBUG
805 0 77 if ($token eq 'processing-instruction') { }
28 49 elsif ($token =~ /^\@($XML::XPathEngine::NCWild|$XML::XPathEngine::QName|$XML::XPathEngine::QNWild)$/o) { }
0 49 elsif ($token =~ /^($XML::XPathEngine::NCName):\*$/o) { }
8 41 elsif ($token =~ /^$XML::XPathEngine::QNWild$/o) { }
34 7 elsif ($token =~ /^$XML::XPathEngine::QName$/o) { }
0 7 elsif ($token eq 'comment()') { }
0 7 elsif ($token eq 'text()') { }
0 7 elsif ($token eq 'node()') { }
0 7 elsif ($token eq 'processing-instruction()') { }
7 0 elsif ($token =~ /^$XML::XPathEngine::AXIS_NAME($XML::XPathEngine::NCWild|$XML::XPathEngine::QName|$XML::XPathEngine::QNWild|$XML::XPathEngine::NODE_TYPE)$/o) { }
817 3 25 if ($token eq '@*') { }
0 25 elsif ($token =~ /^\@($XML::XPathEngine::NCName):\*$/o) { }
25 0 elsif ($token =~ /^\@($XML::XPathEngine::QName)$/o) { }
878 0 7 if ($token eq 'processing-instruction') { }
0 7 elsif ($token =~ /^($XML::XPathEngine::NCName):\*$/o) { }
1 6 elsif ($token =~ /^$XML::XPathEngine::QNWild$/o) { }
6 0 elsif ($token =~ /^$XML::XPathEngine::QName$/o) { }
0 0 elsif ($token eq 'comment()') { }
0 0 elsif ($token eq 'text()') { }
0 0 elsif ($token eq 'node()') { }
0 0 elsif ($token eq 'processing-instruction()') { }
888 0 0 $axis eq 'attribute' ? :
896 0 1 $axis eq 'attribute' ? :
904 0 6 $axis eq 'attribute' ? :
949 0 83 unless defined $token
951 0 83 if $XML::XPathEngine::DEBUG
955 23 60 if ($token eq 'processing-instruction' or $token =~ /^\@($XML::XPathEngine::NCWild|$XML::XPathEngine::QName|$XML::XPathEngine::QNWild)$/o or $token =~ /^($XML::XPathEngine::NCWild|$XML::XPathEngine::QName|$XML::XPathEngine::QNWild)$/o and ($$tokens[$$self{'_tokpos'} + 1] || '') ne '(' or $token =~ /^$XML::XPathEngine::NODE_TYPE$/o or $token =~ /^$XML::XPathEngine::AXIS_NAME($XML::XPathEngine::NCWild|$XML::XPathEngine::QName|$XML::XPathEngine::QNWild|$XML::XPathEngine::NODE_TYPE)$/o) { }
964 0 60 if $XML::XPathEngine::DEBUG