Branch Coverage

blib/lib/Data/ZPath/_Evaluate.pm
Criterion Covered Total %
branch 275 382 71.9


line true false branch
19 14 3 if (index($pat, $candidate) == -1)
33 254 2546 if ($t eq "num")
36 550 1996 if ($t eq "str")
39 906 1090 if ($t eq "path")
42 374 716 if ($t eq "fn")
45 13 703 if ($t eq "un")
49 12 1 if ($ast->{'op'} eq "!")
50 5 7 $x ? :
52 1 0 if ($ast->{'op'} eq "~")
54 0 1 unless defined $n
59 696 7 if ($t eq "bin")
68 22 674 if ($op eq "&&" or $op eq "||")
71 7 8 $lb && $rb ? :
6 1 $lb || $rb ? :
15 7 $op eq '&&' ? :
78 628 46 if ($op eq "==" or $op eq "!=")
81 227 401 if (@l and @r)
85 78 150 if (_equals($ln, $rn))
93 12 616 if $op eq "!="
94 80 548 $eq ? :
98 3 43 if ($op =~ /^( >= | <= | > | < )$/x)
102 3 0 if (defined $ln and defined $rn) { }
103 3 0 $op eq '>' ? :
0 3 $op eq '<=' ? :
0 3 $op eq '>=' ? :
110 0 0 $op eq '>' ? :
0 0 $op eq '<=' ? :
0 0 $op eq '>=' ? :
115 3 0 $ok ? :
119 2 39 if ($op eq "&" or $op eq "|" or $op eq "^")
122 0 4 unless defined $ln and defined $rn
125 1 1 $op eq '|' ? :
2 2 $op eq '&' ? :
130 14 0 if ($op eq "+" or $op eq "-" or $op eq "*" or $op eq "/" or $op eq "%")
134 3 6 if ($op eq "%" and $ln =~ /\./ || $rn =~ /\./)
138 0 36 unless defined $ln and defined $rn
139 0 5 $rn == 0 ? :
0 6 $rn == 0 ? :
5 6 $op eq '/' ? :
13 11 $op eq '*' ? :
4 24 $op eq '-' ? :
8 28 $op eq '+' ? :
145 0 36 unless defined $res
152 7 0 if ($t eq "ternary")
155 4 3 $cond ? :
178 133 1175 if ($seg->{'k'} eq 'root') { }
24 1151 elsif ($seg->{'k'} eq 'dot') { }
13 1138 elsif ($seg->{'k'} eq 'parent') { }
2 1136 elsif ($seg->{'k'} eq 'ancestors') { }
93 1043 elsif ($seg->{'k'} eq 'star') { }
85 958 elsif ($seg->{'k'} eq 'desc') { }
28 930 elsif ($seg->{'k'} eq 'index') { }
7 923 elsif ($seg->{'k'} eq 'fnseg') { }
923 0 elsif ($seg->{'k'} eq 'name') { }
222 28 0 if defined $ch[$idx]
239 158 765 if ($name =~ /^\@/) { }
240 3 155 if ($name eq '@*') { }
249 54 106 unless builtin::blessed($raw) and $raw->isa("XML::LibXML::Element")
251 43 63 if $a
259 4223 0 if defined $_->name
264 1 922 if (defined $seg->{'i'})
270 43 0 if defined $_->name
271 1 43 if defined $m[$idx]
281 95 1213 if ($seg->{'q'} and @{$seg->{'q'};})
284 21 75 if ($q->{'t'} and $q->{'t'} eq "num" and $q->{'v'} =~ /\A[0-9]+\z/)
291 20 1 if (@next and builtin::blessed($next[0]->raw) and $next[0]->raw->isa('XML::LibXML::Node')) { }
296 20 0 defined $next[$idx] ? :
302 1 0 if defined $ch[$idx]
317 51 617 if ($q->{'t'} and $q->{'t'} eq 'path') { }
318 11 40 scalar @r ? :
324 82 586 if $ok
350 1 395 if $name eq "false"
351 12 383 if $name eq "true"
352 1 382 if $name eq "null"
354 68 314 if ($name eq "count")
355 62 6 if (@args)
363 25 289 if ($name eq "index")
364 4 21 if (@args)
369 3 0 if (defined(my $i = $n->ix)) { }
0 0 elsif (defined(my $k = $n->key)) { }
373 0 0 if $k =~ /^[0-9]+$/
381 0 21 unless $cur
385 20 1 if defined $ix
387 0 1 unless defined $id
390 1 0 if (defined $nid and $nid eq $id)
397 93 196 if ($name eq "key")
398 90 3 if (@args)
402 36 0 defined $k ? :
406 0 3 unless $cur and defined $cur->key
410 7 189 if ($name eq "union")
418 2 187 if ($name eq "intersection")
419 0 2 unless @args
427 1 2 unless $next{$k}
433 3 184 if ($name eq "is-first")
435 0 3 unless $cur and $cur->parent
439 3 181 if ($name eq "is-last")
442 0 3 unless @i and @c
443 1 2 $i[0]->primitive_value == $c[0]->primitive_value - 1 ? :
446 88 93 if ($name eq "next" or $name eq "prev")
448 2 86 unless $cur and $cur->parent
454 138 0 if (builtin::blessed($sraw) and builtin::blessed($craw) and $sraw->isa("XML::LibXML::Node") and $craw->isa("XML::LibXML::Node"))
457 52 86 unless eval { do { $sraw->isSameNode($craw) } }
461 0 0 unless defined $siblings[$ix]->id and defined $cur->id
462 0 0 if ($siblings[$ix]->id eq $cur->id)
468 0 86 unless defined $i
469 43 43 $name eq 'next' ? :
470 52 34 if $ni < 0 or $ni > $#siblings
474 7 86 if ($name eq "string")
475 1 6 if (@args)
479 1 0 defined $s ? :
483 0 6 unless $cur
485 6 0 defined $s ? :
488 17 69 if ($name eq "number")
489 17 0 if (@args)
493 17 0 defined $n ? :
497 0 0 unless $cur
499 0 0 defined $n ? :
502 8 61 if ($name eq "value")
503 8 0 if (@args)
511 0 0 unless $cur
515 14 47 if ($name eq "type")
516 8 6 if (@args)
518 3 5 unless @r
524 6 0 $cur ? :
530 12 0 @args ? :
534 3 43 if ($name eq "ceil" or $name eq "floor" or $name eq "round")
538 0 4 unless defined $x
539 1 0 $x >= 0 ? :
2 1 $name eq 'floor' ? :
1 3 $name eq 'ceil' ? :
547 2 38 if ($name eq "sum" or $name eq "min" or $name eq "max")
549 5 0 if (@args) { }
558 0 5 unless @in
560 3 2 if ($name eq "sum")
565 1 1 if ($name eq "min")
578 0 0 @args ? :
582 0 38 if ($name eq "escape")
584 0 0 if (@args) { }
600 0 38 if ($name eq "unescape")
602 0 0 if (@args) { }
618 0 38 if ($name eq "literal")
621 0 0 if (@args) { }
629 1 37 if ($name eq "format")
630 0 1 unless @args >= 1
632 1 0 $fmt[0] ? :
633 1 0 @args > 1 ? :
640 2 35 if ($name eq "index-of" or $name eq "last-index-of")
641 0 2 unless @args >= 1
643 2 0 @args > 1 ? :
646 2 0 $name eq 'index-of' ? :
651 2 33 if ($name eq "string-length")
652 2 0 @args ? :
659 2 31 if ($name eq "upper-case" or $name eq "lower-case")
660 2 0 @args ? :
663 1 1 $name eq 'upper-case' ? :
668 1 30 if ($name eq "substring")
669 0 1 unless @args >= 2
670 1 0 @args > 2 ? :
679 1 29 if ($name eq "match" or $name eq "matches")
680 0 1 unless @args >= 1
684 0 1 @args > 1 ? :
687 1 0 $s =~ /$re/ ? :
691 13 16 if ($name eq "replace")
692 0 13 unless @args >= 2
697 12 1 @args > 2 ? :
704 3 13 if ($name eq "join")
705 0 3 unless @args >= 1
707 3 0 @args > 1 ? :
713 12 1 if ($name eq "url")
714 0 12 @args ? :
718 11 1 if (builtin::blessed($raw) and $raw->can("namespaceURI"))
725 0 1 if ($name eq "local-name")
726 0 0 @args ? :
730 0 0 if (builtin::blessed($raw) and $raw->can('localname')) { }
740 1 0 if ($name eq "tag")
741 1 0 @args ? :
745 1 0 if (builtin::blessed($raw) and $raw->isa("CBOR::Free::Tagged"))
763 5 0 $1 <= $#matches ? :
777 1984 2167 if (builtin::blessed($raw) and $raw->isa("XML::LibXML::Node"))
787 8 673 unless $n
794 0 93 unless $n
800 0 0 unless $n
807 0 228 unless $a and $b
812 0 228 if $b_type eq "null"
813 0 228 if $a_type eq "null"
815 0 228 if ($a_type eq "boolean" and $b_type eq "boolean")
822 67 161 if ($a_type eq "number" and $b_type eq "number")
827 1 66 if ($av =~ /\./ or $bv =~ /\./)
835 140 21 if (grep {$a_type eq $_;} @string_like and grep {$b_type eq $_;} @string_like)
842 18 3 unless $a->id
843 1 2 unless $b->id