Branch Coverage

blib/lib/Class/Container.pm
Criterion Covered Total %
branch 78 136 57.3


line true false branch
14 0 2 unless defined &weaken
59 51 0 if ($HAVE_WEAKEN)
62 19 21 if $$c{$name}{'delayed'}
83 0 0 if ($$spec{'isa'}) { }
88 0 0 if (exists $CONTAINED_OBJECTS{$class}{$name})
95 0 0 if (ref $default eq 'CODE') { }
0 0 elsif (ref $default eq 'ARRAY') { }
0 0 elsif (ref $default eq 'Regexp') { }
105 0 0 unless ($type)
107 0 0 $$spec{'type'} & 4 ? :
0 0 $$spec{'type'} & 8 ? :
0 0 $$spec{'type'} & 1 ? :
0 0 $$spec{'type'} & 2 ? :
115 0 0 defined $default || $$spec{'optional'} ? :
0 0 exists $$spec{'public'} ? :
125 0 0 unless exists $CONTAINED_OBJECTS{$class}
144 12 18 if $param eq 'container'
146 16 2 if (ref $self and defined $$self{$param}) { }
149 2 0 if exists $$spec{'default'}
154 0 6 unless ref $self
155 2 4 $$self{'container'}{'contained'}{$name}{'delayed'} ? :
159 6 0 UNIVERSAL::isa($contained, 'Class::Container') ? :
175 18 5 defined $name ? :
178 11 12 if $args{'delayed'}
180 0 23 unless $self->isa('Class::Container')
182 5 18 ref $self ? :
188 18 0 if ($class->isa('Class::Container')) { }
207 33 5 if (@_)
209 3 30 @_ == 1 && !defined($_[0]) ? :
221 11 13 ref $spec ? :
229 0 1 if $method eq 'DESTROY'
230 0 1 unless ref $self
231 0 1 unless my $subr = $$self{'_decorates'}->can($method)
239 9 2 if $self->SUPER::can($method)
240 2 0 if (ref $self) { }
241 1 1 if $$self{'_decorates'}
264 0 1 unless $HAVE_WEAKEN
271 0 5 unless my $class = $self->contained_class($name)
287 19 35 unless %$c or $DECORATEES{$class}
291 8 27 if ($DECORATEES{$class})
293 3 5 if $args{'decorate_class'} and not ref $args{'decorate_class'}
298 3 5 if (my $c = $args{'decorate_class'})
299 3 0 @$c ? :
300 3 0 unless @$c
302 3 5 if $decorate
325 21 26 if ($$spec{'delayed'}) { }
338 8 26 if $DECORATEES{$class}
347 0 5 unless $$self{'container'}{'contained'}{$name}{'delayed'}
349 5 0 if ($HAVE_WEAKEN)
360 0 4 unless $$self{'container'}{'contained'}{$name}{'delayed'}
369 0 9 unless my $spec = $$self{'container'}{'contained'}{$name}
377 0 0 unless $$self{'container'}{'contained'}{$name}{'delayed'}
380 0 0 if (@_ == 1)
386 0 0 if (keys %args)
400 0 47 unless my $spec = $class->get_contained_object_spec->{$name}
404 0 47 unless $contained_class =~ /^[\w:]+$/
408 1 46 unless $contained_class->isa('Class::Container')
414 20 91 if exists $$args{$_}
422 0 95 unless (eval { do { $module->can('new') } })
426 0 0 if $@
433 71 4 ref $_[0] ? :
451 0 25 if exists $$args{$name}
455 7 18 if (exists $$args{"${name}_class"}) { }
464 0 25 unless $contained_class->can('allowed_params')
479 428 100 if $$cache_in{$class}
485 2 77 unless $superclass->isa('Class::Container')
489 52 48 if (my $x = $$look_in{$class})
493 49 51 if $add