Branch Coverage

blib/lib/XML/Smart/Tie.pm
Criterion Covered Total %
branch 138 222 62.1


line true false branch
38 0 93 unless ($$saver{'keyprev'})
41 0 93 unless (@tree)
43 3 90 if ($I and $I > 0)
57 0 156 if (ref $tree ne 'HASH' and ref $tree ne 'ARRAY')
63 21 135 if ($tree_i =~ /^\[(\d+)\]$/) { }
3 132 elsif (ref $tree eq 'ARRAY') { }
65 21 0 if (exists $$treeprev{$keyprev}) { }
66 9 12 if (ref $$treeprev{$keyprev} ne 'ARRAY')
73 6 15 unless (exists $$treeprev{$keyprev}[$i])
82 0 3 unless (exists $$tree[0])
83 3 0 if (ref $$tree[0] eq 'HASH' and not exists $$tree[0]{$tree_i})
91 45 87 if (exists $$tree{$tree_i}) { }
92 0 45 if (ref $$tree{$tree_i} ne 'HASH' and ref $$tree{$tree_i} ne 'ARRAY')
93 0 0 if ($$tree{$tree_i} ne '') { }
102 27 60 if ($treeprev)
103 12 15 if ($array) { }
104 9 3 if (ref $treeprev eq 'ARRAY') { }
105 6 3 unless $$treeprev[$iprev]{'/order'} and @{$$treeprev[$iprev]{'/order'};}
109 2 1 unless $$treeprev{'/order'} and @{$$treeprev{'/order'};}
114 0 15 if (ref $treeprev eq 'ARRAY') { }
115 0 0 unless $$treeprev[$iprev]{$keyprev}{'/order'} and @{$$treeprev[$iprev]{$keyprev}{'/order'};}
119 9 6 unless $$treeprev{$keyprev}{'/order'} and @{$$treeprev{$keyprev}{'/order'};}
150 0 17 if ref $tree ne 'HASH'
154 17 4 if ($Key eq '' or $Key eq '/order' or $Key eq '/nodes')
188 3 192 if ($$this{'saver'}{'null'})
196 132 63 if ($$this{'saver'}{'array'}) { }
63 0 elsif (exists $$this{'saver'}{'back'}{$key}) { }
197 0 132 unless (exists $$this{'saver'}{'array'}[$i])
203 0 63 if (ref $$this{'saver'}{'back'}{$key} eq 'ARRAY') { }
207 60 3 if ($i == 0) { }
215 133 59 if (ref $point) { }
230 18 24 if ($$this{'saver'}{'null'})
236 9 33 if ($$this{'saver'}{'array'}) { }
18 15 elsif ($i == 0) { }
237 9 0 unless (exists $$this{'saver'}{'array'}[$i] or $key =~ m[^/\.CONTENT])
243 0 18 if (ref $$this{'saver'}{'back'}{$key} eq 'ARRAY') { }
251 15 0 if (exists $$this{'saver'}{'back'}{$key}) { }
258 15 0 unless (exists $$this{'saver'}{'array'}[$i] or $key =~ m[^/\.CONTENT])
259 5 10 unless (exists $$this{'saver'}{'back'}{'/order'})
260 0 20 $_ eq '/order' || $_ eq '/nodes' ? :
279 21 12 if ($$this{'saver'}{'array'}) { }
12 0 elsif ($i == 0 and exists $$this{'saver'}{'back'}{$key}) { }
294 0 0 if ($$this{'saver'}{'array'}) { }
0 0 elsif ($i == 0 and exists $$this{'saver'}{'back'}{$key}) { }
295 0 0 if (exists $$this{'saver'}{'array'}[$i])
309 0 3 if ($$this{'saver'}{'array'}) { }
3 0 elsif ($i == 0 and exists $$this{'saver'}{'back'}{$key}) { }
310 0 0 if (exists $$this{'saver'}{'array'}[$i])
316 3 0 if defined $$this{'saver'}{'back'}{'/nodes'}
330 0 0 if ($$this{'saver'}{'array'}) { }
0 0 elsif (exists $$this{'saver'}{'back'}{$key}) { }
347 6 9 if ($$this{'saver'}{'null'})
353 12 3 unless ($$this{'saver'}{'array'})
354 12 0 if (exists $$this{'saver'}{'back'}{$key}) { }
355 12 0 if (ref $$this{'saver'}{'back'}{$key} ne 'ARRAY')
357 6 6 $gen_null ? :
373 0 3 if ($$this{'saver'}{'null'})
379 0 3 unless ($$this{'saver'}{'array'})
380 0 0 if (exists $$this{'saver'}{'back'}{$key}) { }
381 0 0 if (ref $$this{'saver'}{'back'}{$key} ne 'ARRAY')
383 0 0 $gen_null ? :
401 0 0 if ($$this{'saver'}{'null'})
407 0 0 unless ($$this{'saver'}{'array'})
408 0 0 if (exists $$this{'saver'}{'back'}{$key}) { }
409 0 0 if (ref $$this{'saver'}{'back'}{$key} ne 'ARRAY')
430 3 3 if (not $$this{'saver'}{'array'} and exists $$this{'saver'}{'back'}{$key})
431 0 3 if (ref $$this{'saver'}{'back'}{$key} eq 'ARRAY') { }
438 3 3 if ($$this{'saver'}{'array'})
441 0 3 if ($#{$$this{'saver'}{'array'};} == 0) { }
0 3 elsif ($#{$$this{'saver'}{'array'};} < 0) { }
464 0 3 if (not $$this{'saver'}{'array'} and exists $$this{'saver'}{'back'}{$key})
465 0 0 if (ref $$this{'saver'}{'back'}{$key} eq 'ARRAY') { }
472 3 0 if ($$this{'saver'}{'array'})
475 3 0 if ($#{$$this{'saver'}{'array'};} == 0) { }
0 0 elsif ($#{$$this{'saver'}{'array'};} < 0) { }
514 15 1202 if ($$this{'saver'}{'null'})
525 225 992 if (do { ref $$this{'saver'}{'point'}{$key} eq 'ARRAY' }) { }
848 144 elsif (exists $$this{'saver'}{'point'}{$key}) { }
543 823 250 if (ref $point) { }
554 40 0 unless ($$this{'saver'}{'keyorder'})
563 0 46 unless ($$this{'saver'}{'keyorder'})
567 18 73 if ($found)
568 46 27 if ($key eq $key_i)
580 48 66 if ($$this{'saver'}{'null'})
589 0 114 if (ref $$this{'saver'}{'point'} eq 'ARRAY') { }
0 114 elsif (ref $$this{'saver'}{'point'}{$key} eq 'ARRAY') { }
596 26 88 if (defined $$this{'saver'}{'content'} and keys %{$$this{'saver'}{'point'};} < 1)
604 90 24 unless (exists $$this{'saver'}{'point'}{$key})
605 84 6 if ($key ne '/order' and $key ne '/nodes')
606 72 12 unless ($$this{'saver'}{'keyorder'})
620 0 0 if (exists $$this{'saver'}{'point'}{$key})
624 0 0 if (defined $$this{'saver'}{'point'}{'/order'})
628 0 0 if ($order_i eq $key) { }
632 0 0 if $set
635 0 0 if defined $$this{'saver'}{'point'}{'/nodes'}{$key}
652 0 0 if (exists $$this{'saver'}{'point'}{$key})
663 31 81 if ($$this{'saver'}{'point'}{'/order'}) { }
666 50 106 if ($keys_i eq '' or $keys_i eq '/order' or $keys_i eq '/nodes')
667 49 57 unless ($keys{$keys_i})
675 3 15 if ($Key eq '' or $Key eq '/order' or $Key eq '/nodes')
701 9 132 if ($wantarray) { }
705 3 48 if $wantarray
711 3 3 $#_ > 0 ? :
713 3 3 if ($i =~ /^\d+$/)
716 3 3 if ($k_i =~ m[^/\.CONTENT/$i$])
723 0 3 unless ($set)
738 3 0 if ($$this{'p'}{'/order'})
741 9 9 unless $order_i =~ m[^/\.CONTENT/\d+$]
742 3 0 if (@order_ok) { }
761 57 8 if $$this{'K'}
765 20 40 if ($Key =~ m[^/\.CONTENT/(\d+)$])