Branch Coverage

blib/lib/Data/XHash.pm
Criterion Covered Total %
branch 150 184 81.5


line true false branch
243 0 66 unless $self
276 4 35 if (ref $key eq 'ARRAY' and @$key)
284 25 10 $entry ? :
327 3 200 if ($array_key and @$key) { }
336 74 1 defined $$self{'max_index'} ? :
75 125 if not defined $key or $array_key
339 14 186 if ($options{'nested'})
341 1 13 if (ref $value eq 'HASH') { }
3 10 elsif (ref $value eq 'ARRAY') { }
348 8 192 if (my $entry = $$self{'hash'}{$key}) { }
353 131 61 if (my $tail = $$self{'tail'}) { }
364 151 2 defined $$self{'max_index'} ? :
141 12 if $key =~ /^\d+$/ and defined $$self{'max_index'} ? $key > $$self{'max_index'} : $key >= $self->next_index
389 149 66 if ($$self{'hash'})
430 12 36 ref $_[0] eq 'HASH' ? :
433 0 48 if (ref $key eq 'ARRAY' and @$key)
437 0 0 $$path{'container'} ? :
449 61 2 if (my $link = $$self{'hash'}{$key})
450 4 57 if (ref $to eq 'ARRAY') { }
2 55 elsif (ref $to eq 'HASH') { }
20 35 elsif (blessed $to and $to->isa('Data::XHash')) { }
460 47 14 if ($$link[0] != $link) { }
464 9 38 if defined $$self{'max_index'} and $$self{'max_index'} eq $key
466 15 32 if $$self{'tail'} == $link
475 12 36 $to ? :
491 0 14 if (ref $key eq 'ARRAY' and @$key)
516 3 0 if ($$self{'tail'})
536 1 0 $$self{'tail'} ? :
551 2 1 $entry && $entry != $$self{'tail'}[1] ? :
566 6 3 if ($iter and $iter != $$self{'tail'})
588 0 0 $entry && $entry != $$self{'tail'} ? :
601 1 0 $$self{'tail'} ? :
615 3 16 unless (defined $$self{'max_index'})
619 6 0 if $_ > $$self{'max_index'}
670 17 1 if (my $tail = $$self{'tail'})
678 5 13 if ($options{'index_only'})
680 2 3 if $options{'sorted'}
703 1 1 if (ref $keys eq 'ARRAY')
704 0 2 ref $_ ? :
710 1 0 if (my $tail = $$self{'tail'})
752 12 0 if (my $tail = $$self{'tail'})
784 1 2 wantarray ? :
3 8 unless $$self{'tail'}
787 1 7 wantarray ? :
794 1 2 wantarray ? :
3 8 unless $$self{'tail'}
797 1 7 wantarray ? :
850 0 67 unless ref $list eq 'ARRAY'
852 7 60 if (defined $at_key)
854 0 7 unless $entry
855 2 5 if ($entry != $$self{'tail'})
863 71 73 if (ref $item eq 'HASH') { }
0 73 elsif (ref $item eq 'REF') { }
873 2 65 if $save_tail
885 0 7 unless ref $list eq 'ARRAY'
889 2 5 if (defined $at_key)
891 0 2 unless $$self{'hash'}{$at_key}
898 6 1 if $save_tail
945 7 1 ref $_[0] eq 'HASH' ? :
953 10 25 unless defined $key
954 9 16 if ($options{'indexed_as'} ne 'hash' and $key =~ /^-?\d+$/) { }
961 5 20 if (blessed $new_val and $new_val->isa('Data::XHash')) { }
962 3 2 unless blessed $cur_val and $cur_val->isa('Data::XHash')
1031 0 2 unless $tail
1039 2 3 if ($key =~ /^-?\d+$/) { }
1040 0 2 if ($options{'nested'} and blessed $value and $value->isa('Data::XHash')) { }
1044 0 2 ref($value) =~ /HASH|REF/ ? :
1047 1 2 if ($options{'nested'} and blessed $value and $value->isa('Data::XHash')) { }
1066 3 60 unless $tail
1074 9 181 if ($options{'nested'} and blessed $value and $value->isa('Data::XHash')) { }
1117 0 20 ref $_ eq 'ARRAY' ? :
1121 0 4 unless $$self{'hash'}{$refkey}
1127 14 2 if ($key ne $refkey) { }
2 0 elsif (not $before) { }
1128 14 0 if $$self{'hash'}{$key}
1136 2 2 if $before
1137 3 1 if @after
1159 2 0 ref $_[0] eq 'HASH' ? :
1163 0 2 unless CORE::keys %{+{reverse(%map)};} == CORE::keys %map
1167 12 0 if defined($new_key = $map{$key})
1211 2 0 if (@keys)
1262 7 0 ref $path eq 'ARRAY' ? :
1267 2 5 if (@path and ref $path[-1] eq 'HASH')
1269 2 0 if $op eq 'fetch'
1274 3 4 if $op eq 'store' and not exists $options{'vivify'}
1278 5 7 if (not defined $key && $container->exists($key)) { }
1280 1 4 unless $options{'vivify'}
1284 2 2 unless defined $key
1286 1 3 if (@path or $options{'xhash'}) { }
1294 0 7 if @path || $options{'xhash'} and not blessed $value && $value->isa('Data::XHash')
1298 5 6 if @path
1301 0 6 unless defined $key