Branch Coverage

blib/lib/Class/Container.pm
Criterion Covered Total %
branch 79 136 58.0


line true false branch
15 0 2 unless defined &Class::Container::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)
110 0 0 $spec->{'type'} & 4 ? :
0 0 $spec->{'type'} & 8 ? :
0 0 $spec->{'type'} & 1 ? :
0 0 $spec->{'type'} & 2 ? :
120 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
157 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 8 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 8 unless %$c or $DECORATEES{$class}
291 8 27 if ($DECORATEES{$class})
294 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 20 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)
361 0 4 unless $self->{'container'}{'contained'}{$name}{'delayed'}
370 0 9 unless my $spec = $self->{'container'}{'contained'}{$name}
378 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