Branch Coverage

blib/lib/Tree/Compat/Tree/Simple.pm
Criterion Covered Total %
branch 81 86 94.1


line true false branch
47 3 81 if (blessed $parent and $parent->isa('Tree::Simple')) { }
3 155 elsif (defined $parent and $parent ne $self->ROOT) { }
55 0 81 if (@$children)
70 1 20 unless defined $value
78 1 5 if $tree->is_root
88 75 1 if ($parent) { }
103 1 27 unless @_
105 3 24 unless blessed($_[0]) and $_[0]->isa('Tree::Simple')
107 24 0 $tree->add_child(map({${$_;};} @_)) ? :
116 2 20 unless defined $index
121 2 18 unless $index <= $child_count
123 2 16 unless @_
127 11 8 if blessed $_ and $_->isa('Tree::Simple')
133 8 0 $tree->add_child({'at', $index}, map({${$_;};} @_)) ? :
143 1 10 unless defined $child_to_remove
145 5 5 if (ref $child_to_remove)
146 2 3 unless blessed $child_to_remove and $child_to_remove->isa('Tree::Simple')
150 1 2 unless "$child" eq "$child_to_remove"
154 1 2 unless ($found)
162 2 5 ref $_ ? :
164 0 7 wantarray ? :
171 1 6 unless defined $index
173 1 5 unless (my $child_count = $self->getChildCount) != 0
175 1 4 unless $index < $child_count
183 173 5 wantarray ? :
189 1 87 unless defined $index
198 1 1 if $self->isRoot
204 1 1 if $self->isRoot
211 2 2 if $self->isRoot
219 1 9 if $self->isRoot
225 1 27 if $self->isRoot
234 1 7 unless defined $func
235 2 5 unless ref $func eq 'CODE'
250 4 1 unless blessed $visitor and $visitor->isa('Tree::Simple::Visitor') || $visitor->can('visit')
262 7 25 if (my(@children) = $self->getAllChildren)
271 32 9 unless ref $node
272 0 9 if exists $$seen{$node}
275 3 6 if (blessed $node) { }
276 1 2 if ($node->can('clone')) { }
284 3 3 if (ref $node eq 'SCALAR' or ref $node eq 'REF') { }
1 2 elsif (ref $node eq 'ARRAY') { }
1 1 elsif (ref $node eq 'HASH') { }
321 1 1 unless $_[1]