Branch Coverage

blib/lib/Tree/RB.pm
Criterion Covered Total %
branch 112 170 65.8


line true false branch
45 45 28 if ($node) { }
49 16 12 if (defined $key) { }
51 9 7 $next_fn eq 'successor' ? :
74 0 10 unless defined $arg
76 3 7 if (ref $arg eq 'HASH') { }
83 3 7 if (@_ and exists $args{-'key'})
85 3 0 if (ref $arg eq 'HASH')
89 1 9 unless (exists $args{-'key'})
90 0 1 unless defined $args{'-reverse'}
93 9 1 if ($$self[3])
100 12 8 if ($$self[4]) { }
101 6 6 $$self[4]{'-reverse'} ? :
113 3 8 unless my $node = $$self[3]->next
121 7 32 unless my $node = $$self[3]->next
130 1 6 if ($cmp)
131 0 1 unless ref $cmp eq 'CODE'
140 4 4 if $_[0][0]
144 1 3 if ($$self[0])
161 0 0 unless ref $cmp eq 'CODE'
177 4 14 unless $$self[0]
183 0 10 unless $$self[0]
190 0 51 unless defined $key
196 3 48 unless my $x = $$self[0]
201 0 116 $cmp ? :
30 86 if ($cmp ? &$cmp($key, $$x[4]) == 0 : $key eq $$x[4])
204 0 30 if ($mode == 3 or $mode == 5) { }
0 30 elsif ($mode == 4 or $mode == 6) { }
211 12 18 wantarray ? :
214 0 86 $cmp ? :
41 45 if ($cmp ? &$cmp($key, $$x[4]) < 0 : $key lt $$x[4]) { }
224 10 8 if ($mode == 1 or $mode == 3) { }
8 0 elsif ($mode == 2 or $mode == 4) { }
225 5 5 if ($next_child == 1) { }
226 3 2 wantarray ? :
229 3 2 unless my $next = $y->successor
231 0 2 wantarray ? :
235 3 5 if ($next_child == 2) { }
236 2 1 wantarray ? :
239 3 2 unless my $next = $y->predecessor
241 1 1 wantarray ? :
253 0 8 unless $i =~ /^-?\d+$/
255 4 4 if ($i < 0)
258 0 8 if ($i < 0 or $i >= $$self[2])
263 4 4 if ($i > $$self[2] / 2) { }
291 0 40 unless defined $key_or_node
296 0 40 ref $key_or_node eq 'Tree::RB::Node' ? :
305 8 45 $cmp ? :
0 53 if ($cmp ? &$cmp($$z[4], $$x[4]) == 0 : $$z[4] eq $$x[4])
313 8 45 $cmp ? :
25 28 if ($cmp ? &$cmp($$z[4], $$x[4]) < 0 : $$z[4] lt $$x[4]) { }
324 8 32 if (not defined $y) { }
328 5 27 $cmp ? :
17 15 if ($cmp ? &$cmp($$z[4], $$y[4]) < 0 : $$z[4] lt $$y[4]) { }
345 0 40 unless my $x = shift()
350 1 6 if (($$x[0] || 0) == ($$x[0][0][1] || 0)) { }
358 7 0 if ($y and $$y[3] == 0) { }
365 0 0 if ($x == ($$x[0][$child] || 0))
379 0 7 unless defined $key_or_node
382 0 7 ref $key_or_node eq 'Tree::RB::Node' ? :
385 0 7 unless $z
388 1 6 if ($$z[1] and $$z[2]) { }
410 4 3 if (defined $x) { }
2 1 elsif (not defined $$y[0]) { }
412 0 4 if (not defined $$y[0]) { }
2 2 elsif ($y == $$y[0][1]) { }
425 4 0 if ($$y[3] == 1)
435 1 0 if ($$y[3] == 1)
438 1 0 if (defined $$y[0])
440 0 1 if ($y == $$y[0][1]) { }
1 0 elsif ($y == $$y[0][2]) { }
457 0 5 unless my $x = shift()
462 0 1 if ($x == left_of(parent_of($x))) { }
473 0 1 if (color_of($w) == 0)
479 1 0 if (color_of(&$child2($w)) == 1 and color_of(&$child1($w)) == 1) { }
485 0 0 if (color_of(&$child1($w)) == 1)
503 0 0 unless my $x = shift()
505 0 0 unless my $y = $$x[2]
508 0 0 if ($$y[1])
512 0 0 if (not defined $$x[0]) { }
516 0 0 $x == $$x[0][1] ? :
526 0 0 unless my $y = shift()
528 0 0 unless my $x = $$y[1]
531 0 0 if ($$x[2])
535 0 0 if (not defined $$y[0]) { }
539 0 0 $y == $$y[0][2] ? :