Branch Coverage

blib/lib/Data/Selector.pm
Criterion Covered Total %
branch 95 118 80.5


line true false branch
240 0 97 unless defined $args->{'selector_string'} and length $args->{'selector_string'}
242 5 92 if (index($args->{'selector_string'}, '$') != -1)
247 5 1 $2 ? :
6 0 defined $args->{'named_selectors'}{$1} && length $args->{'named_selectors'}{$1} ? :
257 0 97 if length $args->{'selector_string'} and not $args->{'selector_string'} =~ /[^.\[\],]/o
258 0 97 if index($queue[0][0], '][') != -1
259 0 97 if index($queue[0][0], '[]') != -1
260 0 97 if index($queue[0][0], '[,') != -1
261 0 97 if index($queue[0][0], ',]') != -1
262 0 97 if index($queue[0][0], '[.') != -1
263 0 97 if index($queue[0][0], '.]') != -1
264 0 97 if substr($queue[0][0], 0, 1) eq ','
265 0 97 if substr($queue[0][0], -1) eq ','
266 0 97 if substr($queue[0][0], 0, 1) eq '.'
267 0 97 if substr($queue[0][0], -1) eq '.'
268 0 97 unless $queue[0][0] =~ tr/[// == $queue[0][0] =~ tr/]//
271 0 97 if $args->{'selector_string'} =~ /[^.,]\[/o
273 0 97 if $args->{'selector_string'} =~ /\][^.,\]]/o
286 30 493 if ($is_suffix) { }
294 2 491 if $opening_bracket_pos > -1 and $dot_in_prefix_pos > $opening_bracket_pos
298 187 306 if ($dot_in_prefix_pos > -1)
301 18 169 if ($is_range)
304 0 18 if $opening_bracket_pos > -1 and $dot_in_prefix_pos > $opening_bracket_pos
311 173 320 if ($dot_in_prefix_pos >= 1) { }
50 270 elsif ($opening_bracket_pos == 0) { }
314 74 99 if $dot_in_prefix_pos + 1 == $opening_bracket_pos
327 443 50 if (length $bare)
329 369 74 if $first_char ne '+' and $first_char ne '-'
331 43 400 $first_char eq '-' ? :
334 193 250 if ($sub_tree->{$bare}) { }
341 55 438 if (not length $string || $prev_is_suffix and @{$token->[2];})
347 277 1 !($is_suffix || $prev_is_suffix) ? :
278 245 if length $string
357 30 345 if $shift_a_suffix
377 0 66 unless $args->{'selector_tree'}
378 0 66 unless $args->{'data_tree'}
408 21 128 index($selector_tree_key_base, '*') != -1 ? :
430 83 47 $data_tree_type eq 'HASH' ? :
437 105 44 if not $has_includes and index($_->[0], '+') == 0
439 20 129 if (index($_->[0], '+-') == 0 or index($_->[0], '--') == 0)
441 14 6 if ($_->[0] =~ /^(\+|-)(-\d+)$/o)
444 10 4 $2 < 0 && $2 >= -@{$data_tree;} ? :
450 14 135 if ($data_tree_type eq 'ARRAY' and index($_->[0], '..') != -1)
452 14 14 if $_ < 0
461 114 0 defined $_->[1] ? :
21 114 defined $_->[2] ? :
14 135 defined $_->[3] ? :
484 45 138 if (index($matching_selector_keys->[-1], '-') == 0) { }
485 30 15 if ($data_tree_type eq 'HASH') { }
491 15 0 if $ok
509 92 46 $data_tree_type eq 'HASH' ? :
518 133 5 @{$matching_selector_keys;} == 1 ? :
523 64 74 if ref $data_sub_tree and grep {$_ ne '_order_';} keys %{$selector_sub_tree;}
529 9 121 if ($has_includes and not %matched_includes)
538 92 13 if (@data_tree_keys)
542 0 92 unless $data_tree_type
544 66 26 if ($data_tree_type eq 'HASH') { }
552 26 0 if $ok
560 60 48 $_ eq '_to_be_trimmed_' ? :