Branch Coverage

blib/lib/Sub/Accessor/Small.pm
Criterion Covered Total %
branch 74 158 46.8


line true false branch
16 8 0 eval { do { require Sub::Util } } ? :
19 0 8 !&HAS_SUB_UTIL() && eval { do { require Sub::Name } } ? :
57 24 0 ref $_[0] eq 'HASH' ? :
58 24 0 @_ % 2 ? :
62 24 0 if defined $export_opts->{'into'} and not ref $export_opts->{'into'}
64 24 0 $package ? :
96 76 44 unless defined $me->{$type}
100 1 23 if (defined $me->{'handles'})
102 1 0 if ($me->{'traits'} or $me->{'handles_via'})
110 1 0 if ($shv_data)
126 1 1 ref $target ? :
133 0 1 unless ($shv_data)
146 4 7 $me->{'is'} eq 'lazy' ? :
4 11 $me->{'is'} eq 'rwp' ? :
5 15 $me->{'is'} eq 'rw' ? :
4 20 $me->{'is'} eq 'ro' ? :
148 4 20 wantarray ? :
156 0 46 unless defined $target
158 3 43 if (not ref $target and $target =~ /\A[^\W0-9]\w+\z/)
169 43 0 if (ref $target eq 'SCALAR' and not defined $$target)
175 0 0 if (not ref $target and $target eq 1)
187 0 0 if (ref $me->{'handles'} eq 'ARRAY') { }
0 0 elsif (ref $me->{'handles'} eq 'HASH') { }
214 0 24 $me->{'slot'} =~ /\A_/ ? :
218 120 48 unless exists $me->{$type}
219 46 2 if ref $me->{$type}
220 2 0 if $me->{$type} ne 1
223 0 0 unless defined $me->{'slot'}
234 0 24 if (ref $me->{'builder'} eq 'CODE')
242 0 0 unless defined $name and defined $me->{'package'}
244 0 0 $name =~ /\A_/ ? :
263 0 2 if ($me->{'is'} eq 'rw') { }
0 2 elsif ($me->{'is'} eq 'ro') { }
0 2 elsif ($me->{'is'} eq 'rwp') { }
0 2 elsif ($me->{'is'} eq 'lazy') { }
266 0 0 if not exists $me->{'accessor'} and defined $name
271 0 0 if not exists $me->{'reader'} and defined $name
276 0 0 if not exists $me->{'reader'} and defined $name
278 0 0 if not exists $me->{'writer'} and defined $name
283 0 0 if not exists $me->{'reader'} and defined $name
285 0 0 unless exists $me->{'lazy'}
287 0 0 unless $me->{'builder'} or $me->{'default'}
294 19 5 unless exists $me->{'default'}
296 0 5 unless (ref $me->{'default'})
303 0 5 unless ref $me->{'default'} eq 'CODE'
310 0 24 if (my $does = $me->{'does'})
312 0 0 if &blessed($_[0])
315 0 24 if (defined $me->{'isa'} and not ref $me->{'isa'})
318 0 0 unless eval { do { require Type::Utils } }
323 0 0 $me->{'package'} ? :
331 0 24 if (defined $me->{'trigger'} and not ref $me->{'trigger'})
342 0 24 if $me->{'initializer'}
343 0 24 if $me->{'traits'}
344 0 24 if $me->{'lazy_build'}
368 46 0 defined $me->{'slot'} ? :
461 0 0 if (ref $method eq 'ARRAY') { }
489 0 29 if ($me->{'auto_deref'})
504 5 17 if ($me->{'lazy'})
508 5 0 if ($me->{'default'}) { }
0 0 elsif (defined $me->{'builder'}) { }
566 5 4 if ($coerce eq '$_[1]')
568 5 0 unless ($me->{'trigger'} or $me->{'weak_ref'})
611 8 4 if ($coerce eq '$_[1]')
613 7 0 unless ($me->{'lazy'} or $me->{'trigger'} or $me->{'weak_ref'})
648 13 8 unless my $coercion = $me->{'coerce'}
650 8 0 unless (ref $coercion)
654 8 0 if (&blessed($type) and $type->can('coercion')) { }
0 0 elsif (&blessed($type) and $type->can('coerce')) { }
667 0 8 unless (ref $coercion)
674 8 0 if (&blessed($coercion) and $coercion->can('can_be_inlined') and $coercion->can_be_inlined and $coercion->can('inline_coercion'))
685 0 0 if (&blessed($coercion) and $coercion->can('coerce'))
699 11 10 unless my $type = $me->{'isa'}
701 10 0 if (&blessed($type) and $type->isa('Type::Tiny') and $type->can_be_inlined)
706 10 0 if ($ass =~ /\Ado \{(.+)\};\z/ms)
718 0 0 if (&blessed($type) and $type->can('can_be_inlined') and $type->can_be_inlined)
723 0 0 if ($inliner)
729 0 0 if (&blessed($type) and $type->can('check') and $type->can('get_message'))
743 9 0 unless $me->{'weak_ref'}
757 1 8 unless my $trigger = $me->{'trigger'}