Branch Coverage

blib/lib/JSON/Path/Evaluator.pm
Criterion Covered Total %
branch 167 216 77.3


line true false branch
56 0 147 ref $_[0] eq 'HASH' ? :
59 0 294 unless $args{$key}
66 5 115 $self->{'expression'} =~ /\$_/ ? :
27 120 $args{'script_engine'} ? :
75 90 57 unless (ref $json_object)
87 145 2 wantarray ? :
105 147 0 if $token_stream->[0] eq $JSON::Path::Evaluator::TOKEN_ROOT
106 128 19 if $token_stream->[0] eq $JSON::Path::Evaluator::TOKEN_CHILD
108 12 135 if ($args{'want_path'})
114 10 8 ref ${$ref;} ? :
132 9 73 if (_arraylike($json_object)) { }
67 6 elsif (_hashlike($json_object)) { }
135 33 0 if (ref $json_object->[$_]) { }
146 37 204 if (ref $json_object->{$index}) { }
160 84 784 unless ref $obj
165 284 1255 if $token eq $JSON::Path::Evaluator::TOKEN_CURRENT
166 471 784 if $token eq $JSON::Path::Evaluator::TOKEN_CHILD
168 73 711 if ($token eq $JSON::Path::Evaluator::TOKEN_FILTER_OPEN) { }
16 695 elsif ($token eq $JSON::Path::Evaluator::TOKEN_RECURSIVE) { }
172 0 73 if $ASSERT_ENABLE
177 39 34 if (not @{$token_stream;}) { }
179 7 32 $want_ref ? :
189 2 14 if ($index eq $JSON::Path::Evaluator::TOKEN_FILTER_OPEN)
193 0 2 if $ASSERT_ENABLE
199 6 8 unless (@{$token_stream;})
206 98 597 if ($token eq $JSON::Path::Evaluator::TOKEN_SUBSCRIPT_OPEN) { }
209 0 98 if $ASSERT_ENABLE
215 666 29 if $index ne $JSON::Path::Evaluator::TOKEN_ALL
216 0 695 if $ASSERT_ENABLE
219 419 276 if (not @{$token_stream;}) { }
220 44 375 $want_ref ? :
233 106 7 if ($self->{'script_engine'} eq 'PseudoJS') { }
7 0 elsif ($self->{'script_engine'} eq 'perl') { }
254 0 897 if $ASSERT_ENABLE
261 32 865 if (ref $object eq "REF")
265 29 868 if ($index eq $JSON::Path::Evaluator::TOKEN_ALL) { }
266 3 26 if (_hashlike($object)) { }
275 9 859 if ($index =~ /$JSON::Path::Evaluator::TOKEN_ARRAY_SLICE/) { }
5 854 elsif ($index =~ /$JSON::Path::Evaluator::TOKEN_UNION/) { }
276 0 9 _hashlike($object) ? :
286 689 179 if (_hashlike($object)) { }
287 85 604 if ($create_key) { }
293 568 37 if exists $object->{$index}
300 18 161 if ($create_key) { }
306 152 0 if exists $object->[$index]
318 11 2 _arraylike($object) ? :
27 13 _hashlike($object) ? :
335 0 0 unless defined $token
337 0 0 if ($token eq $JSON::Path::Evaluator::TOKEN_SUBSCRIPT_OPEN)
341 0 0 if ($token eq $JSON::Path::Evaluator::TOKEN_SUBSCRIPT_CLOSE)
348 0 0 if $ASSERT_ENABLE
350 0 0 if (grep {$_ eq $JSON::Path::Evaluator::TOKEN_ARRAY_SLICE;} @substream) { }
0 0 elsif (grep {$_ eq $JSON::Path::Evaluator::TOKEN_UNION;} @substream) { }
359 0 0 if ($substream[0] eq $JSON::Path::Evaluator::TOKEN_ARRAY_SLICE)
364 0 0 if ($substream[2] eq $JSON::Path::Evaluator::TOKEN_ARRAY_SLICE)
394 0 9 if (not defined $start or $start eq "")
397 6 3 if (not defined $end or $end eq "")
400 9 0 if (not defined $step or $step eq "")
404 6 3 if $start == -1
405 6 3 if $end == -1
408 0 9 if ($step < 0) { }
429 2 279 if (ref $obj eq "REF")
433 82 199 if (_arraylike($obj)) { }
191 8 elsif (_hashlike($obj)) { }
434 0 0 if (&looks_like_number($index) and exists $obj->[$index])
435 0 0 $want_ref ? :
438 136 115 unless ref $obj->[$_]
443 16 175 if (exists $obj->{$index})
444 8 8 $want_ref ? :
447 439 152 unless ref $val
463 2 2 $want_ref ? :
470 84 38 unless ref $got
494 55 86 if (_hashlike($object)) { }
84 2 elsif (_arraylike($object)) { }
498 22 34 if _compare($operator, $got, $rhs)
506 91 119 if _compare($operator, $got, $rhs)
512 71 25 if $val == @expressions_and
526 58 83 if ($expression =~ /$JSON::Path::Evaluator::EQUAL_SIGN/) { }
528 27 31 if (substr($expression, $position + 1, 1) eq $JSON::Path::Evaluator::EQUAL_SIGN) { }
18 13 elsif (substr($expression, $position + 1, 1) eq $JSON::Path::Evaluator::TILDE_SIGN) { }
529 0 27 if (substr($expression, $position + 2, 1) eq $JSON::Path::Evaluator::EQUAL_SIGN) { }
541 11 2 if ($preceding_char eq $JSON::Path::Evaluator::GREATER_THAN_SIGN) { }
0 2 elsif ($preceding_char eq $JSON::Path::Evaluator::LESS_THAN_SIGN) { }
0 2 elsif ($preceding_char eq $JSON::Path::Evaluator::EXCLAMATION_MARK) { }
558 410 104 if /$JSON::Path::Evaluator::EQUAL_SIGN/
559 75 29 if ($expression =~ /$_/)
568 133 8 if ($operator) { }
598 2 5 if (_hashlike($object)) { }
602 0 10 if $@
603 2 8 if $ret
610 0 18 if $@
611 8 10 if $ret
621 15 251 if ($operator eq $OPERATOR_IS_TRUE)
622 11 4 $lhs ? :
627 62 185 if ($operator eq "=" or $operator eq "==" or $operator eq "===")
628 8 58 $use_numeric ? :
630 26 159 if ($operator eq "<")
631 26 0 $use_numeric ? :
633 83 76 if ($operator eq ">")
634 55 28 $use_numeric ? :
636 0 76 if ($operator eq "<=")
637 0 0 $use_numeric ? :
639 22 54 if ($operator eq ">=")
640 16 6 $use_numeric ? :
642 0 54 if ($operator eq "!=" or $operator eq "!==")
643 0 0 $use_numeric ? :
646 54 0 if ($operator eq "=~")
647 54 0 if ($rhs =~ m[^/(.*)/([msian]*)$]) { }