Branch Coverage

blib/lib/Class/XPath.pm
Criterion Covered Total %
branch 62 82 75.6


line true false branch
20 0 2 unless @_
41 0 2 unless defined $target
47 0 0 $from_import ? :
0 18 unless $required{$_}
53 0 0 $from_import ? :
0 18 unless exists $args{$_}
61 0 14 if ref $args{$_} and ref $args{$_} eq 'CODE'
63 0 14 if $@
82 0 169 unless defined $xpath
89 0 169 if $xpath eq '/'
93 0 169 if $xpath eq '.'
100 1 168 if ($xpath =~ m[^//(.*)$]) { }
92 76 elsif ($xpath =~ m[^/(.*)$]) { }
27 49 elsif ($xpath =~ m[^\.\./(.*)$]) { }
0 49 elsif ($xpath =~ m[^\./(.*)$]) { }
126 6 168 if (/^$NAME$/) { }
117 51 elsif (/^($NAME)\[(-?\d+)\]$/o) { }
6 45 elsif (/^($NAME)\[\@($NAME)\s*=\s*"([^"]+)"\]$/o or /^($NAME)\[\@($NAME)\s*=\s*'([^']+)'\]$/o) { }
13 32 elsif (/^($NAME)\[\@($NAME)\s*(=|>|<|<=|>=|!=)\s*(\d+)\]$/o) { }
14 18 elsif (/^($NAME)\[($NAME|\.)\s*=\s*"([^"]+)"\]$/o or /^($NAME)\[($NAME|\.)\s*=\s*'([^']+)'\]$/o) { }
13 5 elsif (/^($NAME)\[($NAME|\.)\s*(=|>|<|<=|>=|!=)\s*(\d+)\]$/) { }
5 0 elsif (/^\@($NAME)$/) { }
151 1 4 if $count != @parts
159 0 168 unless @patterns
192 116 111 if (defined $$pat{'index'}) { }
27 84 elsif (defined $$pat{'attr'}) { }
27 57 elsif (defined $$pat{'child'}) { }
194 116 0 if abs $$pat{'index'} <= $#kids
197 19 8 if (defined $$pat{'name'}) { }
204 4 33 if $op eq 'eq' and $value eq $$pat{'value'} or $op eq '=' and $value == $$pat{'value'} or $op eq '!=' and $value != $$pat{'value'} or $op eq '>' and $value > $$pat{'value'} or $op eq '<' and $value < $$pat{'value'} or $op eq '>=' and $value >= $$pat{'value'} or $op eq '<=' and $value <= $$pat{'value'}
217 8 0 if grep {$_ eq $attr;} &$get_attr_names($self)
220 0 27 unless defined $$pat{'name'}
226 6 75 $$pat{'child'} eq '.' ? :
233 465 36 if defined $txt
235 0 405 unless defined $value
236 4 373 if $op eq 'eq' and $value eq $$pat{'value'} or $op eq '=' and $value == $$pat{'value'} or $op eq '!=' and $value != $$pat{'value'} or $op eq '>' and $value > $$pat{'value'} or $op eq '<' and $value < $$pat{'value'} or $op eq '>=' and $value >= $$pat{'value'} or $op eq '<=' and $value <= $$pat{'value'}
251 223 4 unless @patterns
264 169 207 unless defined $parent
270 207 441 if $kid == $self
271 294 147 if &$get_name($kid) eq $name
275 39 168 &$get_parent($parent) ? :