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 0 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 41 unless defined $key_or_node
296 0 41 ref $key_or_node eq 'Tree::RB::Node' ? :
305 8 48 $cmp ? :
1 55 if ($cmp ? &$cmp($z->[4], $x->[4]) == 0 : $z->[4] eq $x->[4])
313 8 47 $cmp ? :
26 29 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]) { }
346 0 40 unless my $x = shift()
351 1 6 if (($x->[0] || 0) == ($x->[0][0][1] || 0)) { }
359 7 0 if ($y and $y->[3] == 0) { }
366 0 0 if ($x == ($x->[0][$child] || 0))
380 0 7 unless defined $key_or_node
383 0 7 ref $key_or_node eq 'Tree::RB::Node' ? :
386 0 7 unless $z
389 1 6 if ($z->[1] and $z->[2]) { }
411 4 3 if (defined $x) { }
2 1 elsif (not defined $y->[0]) { }
413 0 4 if (not defined $y->[0]) { }
2 2 elsif ($y == $y->[0][1]) { }
426 4 0 if ($y->[3] == 1)
436 1 0 if ($y->[3] == 1)
439 1 0 if (defined $y->[0])
441 0 1 if ($y == $y->[0][1]) { }
1 0 elsif ($y == $y->[0][2]) { }
458 0 5 unless my $x = shift()
463 0 1 if ($x == left_of(parent_of($x))) { }
474 0 1 if (color_of($w) == 0)
480 1 0 if (color_of(&$child2($w)) == 1 and color_of(&$child1($w)) == 1) { }
486 0 0 if (color_of(&$child1($w)) == 1)
504 0 0 unless my $x = shift()
506 0 0 unless my $y = $x->[2]
509 0 0 if ($y->[1])
513 0 0 if (not defined $x->[0]) { }
517 0 0 $x == $x->[0][1] ? :
527 0 0 unless my $y = shift()
529 0 0 unless my $x = $y->[1]
532 0 0 if ($x->[2])
536 0 0 if (not defined $y->[0]) { }
540 0 0 $y == $y->[0][2] ? :