Branch Coverage

blib/lib/Contextual/Return.pm
Criterion Covered Total %
branch 305 558 54.6


line true false branch
16 31 0 unless (defined $fallback_caller)
21 7 136 if (caller() eq 'DB')
27 1 142 unless @caller
28 53 89 unless wantarray
29 9 80 @_ ? :
35 18 17 if (caller eq 'DB') { }
37 0 18 if ($fallback_caller) { }
38 0 0 if $Contextual::Return::uplevel
43 18 0 if $Contextual::Return::uplevel
49 0 17 if ($fallback_caller) { }
50 0 0 if $Contextual::Return::uplevel
55 17 0 if $Contextual::Return::uplevel
60 6 29 unless @caller
61 5 24 unless wantarray
62 23 1 @_ ? :
70 1 0 unless $Contextual::Return::uplevel
75 2 4 unless $Contextual::Return::uplevel
93 2 14 unless $attrs
96 2 12 if (exists $attrs->{'BLESSED'})
103 56 12 unless my $handler = $attrs->{$context}
109 6 6 if $was_blessed
135 18 123 unless defined $package
138 23 100 if $package =~ /^Contextual::Return/msx
145 30 70 if do { no strict 'refs'; *{$package . '::CARP_NOT';}{'ARRAY'} }
149 48 22 if $package eq $orig_package and $prev_package eq $orig_package
156 37 3 unless $msg =~ s//$LOC/g
197 68 0 if (require Contextual::Return::Failure)
206 8 60 @_ ? :
213 6 9 defined $next_arg && !ref($next_arg) && !exists $STD_NAME_FOR{$next_arg} ? :
238 0 15 if ($selector_type eq 'ARRAY') { }
4 11 elsif ($selector_type eq 'Regexp') { }
10 1 elsif ($selector_type eq 'literal') { }
243 1 3 unless (@selected)
251 1 9 unless exists $STD_NAME_FOR{$selector}
280 1 39 unless (@_)
281 0 0 unless $Contextual::Return::__RESULT__
0 1 $context ? :
294 33 1 defined $context ? :
5 34 $context ? :
318 10 18 if (@_ == 0) { }
18 0 elsif (@_ == 1 and $impl = tied $_[0]) { }
324 0 18 if exists $impl->{$subname}
328 0 0 defined $_ ? :
0 0 tied $_ ? :
338 1 0 if (not defined wantarray and $impl->{'NVALUE'})
373 2 19 if ($wantarray)
380 0 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
383 0 2 if ($recover) { }
0 2 elsif ($@) { }
384 0 0 unless ($Contextual::Return::__RESULT__)
393 2 0 unless $Contextual::Return::__RESULT__
397 0 0 if (not $attrs->{'STRICT'} and my $handler = $attrs->{'ARRAYREF'})
400 0 0 if ($recover) { }
0 0 elsif ($@) { }
401 0 0 unless ($Contextual::Return::__RESULT__)
411 0 0 if $Contextual::Return::__RESULT__
414 0 0 if (ref $array_ref || '') eq 'ARRAY'
419 0 0 if $attrs->{'STRICT'}
420 0 0 if exists $attrs->{$context}
423 0 0 if ($recover) { }
432 1 18 unless (defined $wantarray)
437 0 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
440 0 0 if ($recover) { }
0 0 elsif ($@) { }
448 1 0 if ($attrs->{'STRICT'})
450 0 1 if ($recover) { }
469 2 142 unless @_
473 12 130 if (not &refaddr($crv)) { }
476 0 12 unless (defined $subname)
489 1 141 if exists $attrs->{'LIST'}
502 2 139 if ($wantarray)
506 0 2 if ($recover) { }
0 2 elsif ($@) { }
507 0 0 unless ($Contextual::Return::__RESULT__)
516 2 0 unless $Contextual::Return::__RESULT__
521 0 139 unless (defined $wantarray)
526 0 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
529 0 0 if ($recover) { }
0 0 elsif ($@) { }
537 0 0 if ($attrs->{'STRICT'})
539 0 0 if ($recover) { }
559 6 56 unless @_
563 6 50 if (not &refaddr($crv)) { }
566 0 6 unless (defined $subname)
579 0 56 if exists $attrs->{'VOID'}
592 6 50 if ($wantarray)
599 0 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
602 0 6 if ($recover) { }
0 6 elsif ($@) { }
603 0 0 unless ($Contextual::Return::__RESULT__)
612 3 3 unless $Contextual::Return::__RESULT__
616 0 0 if (not $attrs->{'STRICT'} and my $handler = $attrs->{'ARRAYREF'})
619 0 0 if ($recover) { }
0 0 elsif ($@) { }
620 0 0 unless ($Contextual::Return::__RESULT__)
630 0 0 if $Contextual::Return::__RESULT__
633 0 0 if (ref $array_ref || '') eq 'ARRAY'
638 0 0 if $attrs->{'STRICT'}
639 0 0 if exists $attrs->{$context}
642 0 0 if ($recover) { }
651 2 48 unless (defined $wantarray)
654 0 2 if ($recover) { }
0 2 elsif ($@) { }
675 3 135 unless (@_)
683 11 124 if (not &refaddr($crv)) { }
686 0 11 unless (defined $subname)
700 0 135 if exists $attrs->{$context}
714 2 133 if ($wantarray)
722 6 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
725 0 1 if ($recover) { }
0 1 elsif ($@) { }
726 0 0 unless ($Contextual::Return::__RESULT__)
735 1 0 unless $Contextual::Return::__RESULT__
739 0 1 if (not $attrs->{'STRICT'} and my $handler = $attrs->{'ARRAYREF'})
742 0 0 if ($recover) { }
0 0 elsif ($@) { }
743 0 0 unless ($Contextual::Return::__RESULT__)
753 0 0 if $Contextual::Return::__RESULT__
756 0 0 if (ref $array_ref || '') eq 'ARRAY'
761 0 5 if $attrs->{'STRICT'}
762 1 4 if exists $attrs->{$context}
768 1 132 unless (defined $wantarray)
773 0 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
776 0 1 if ($recover) { }
1 0 elsif ($@) { }
785 0 0 if ($attrs->{'STRICT'})
787 0 0 if ($recover) { }
815 219 906 if (not &refaddr($crv)) { }
818 0 219 unless (defined $subname)
831 1125 0 if ($context_name ne '_internal_LIST')
833 0 1125 if exists $attrs->{$context_name}
848 15 1110 if ($wantarray)
849 0 15 $context_name eq 'RECOVER' ? :
859 24 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
862 2 10 if ($recover) { }
3 7 elsif ($@) { }
863 2 0 unless ($Contextual::Return::__RESULT__)
872 6 3 unless $Contextual::Return::__RESULT__
876 1 2 if (not $attrs->{'STRICT'} and my $handler = $attrs->{'ARRAYREF'})
881 0 1 if ($recover) { }
0 1 elsif ($@) { }
882 0 0 unless ($Contextual::Return::__RESULT__)
891 0 1 if $Contextual::Return::__RESULT__
894 1 0 if (ref $array_ref || '') eq 'ARRAY'
899 0 5 if $attrs->{'STRICT'}
900 2 3 if exists $attrs->{$context}
903 0 0 if ($recover) { }
912 6 1104 unless (defined $wantarray)
915 3 6 unless ($attrs->{$context})
916 0 3 if $attrs->{'STRICT'}
922 1 5 if ($recover) { }
4 1 elsif ($@) { }
931 0 2 if ($attrs->{'STRICT'})
933 0 0 if ($recover) { }
965 0 0 unless $type
966 0 0 $type eq 'ARRAY' ? :
0 0 $type eq 'SCALAR' ? :
968 0 0 if (&refaddr($ref) == &refaddr($obj_ref))
989 0 0 if (my $exception = $@)
990 0 0 if ($exception =~ /$no_handler_message/)
1001 0 0 if (ref $retval eq 'REF' and eval { do { ${$retval;} == ${$self;} } })
1017 0 0 if (exists $attrs_ref->{'VOID'} or exists $attrs_ref->{'DEFAULT'}) { }
1054 0 0 if (eval { do { require Data::Dumper; 1 } }) { }
1056 0 0 if (eval { do { ref($crv)->isa('Contextual::Return::Value') } })
1090 56 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
1096 4 35 if (my $recover = $attrs->{'RECOVER'}) { }
3 32 elsif ($@) { }
1097 4 0 unless ($Contextual::Return::__RESULT__)
1106 8 28 if ($Contextual::Return::__RESULT__)
1110 2 34 if ($attrs->{'FIXED'}) { }
34 0 elsif (not $attrs->{'ACTIVE'}) { }
1119 0 0 if (my $recover = $attrs->{'RECOVER'}) { }
1136 20 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
1142 5 25 if (my $recover = $attrs->{'RECOVER'}) { }
3 22 elsif ($@) { }
1143 5 0 unless ($Contextual::Return::__RESULT__)
1152 9 18 if ($Contextual::Return::__RESULT__)
1156 1 26 if ($attrs->{'FIXED'}) { }
26 0 elsif (not $attrs->{'ACTIVE'}) { }
1165 0 0 if (my $recover = $attrs->{'RECOVER'}) { }
1180 19 15 $attrs->{'want_pure_bool'} ? :
1187 1 0 unless my $handler = $attrs->{$context} or $context eq 'BOOL' and $attrs->{'STRICT'} and last handler
1193 0 1 if $_[0] =~ /^Exiting \S+ via next/
1194 1 0 if $outer_sig_warn
1199 4 30 if (my $recover = $attrs->{'RECOVER'}) { }
0 30 elsif ($@) { }
1200 4 0 unless ($Contextual::Return::__RESULT__)
1209 8 26 if ($Contextual::Return::__RESULT__)
1213 1 33 if ($attrs->{'FIXED'}) { }
33 0 elsif (not $attrs->{'ACTIVE'}) { }
1222 0 0 if (my $recover = $attrs->{'RECOVER'}) { }
1238 32 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
1244 1 14 if (my $recover = $attrs->{'RECOVER'}) { }
0 14 elsif ($@) { }
1245 1 0 unless ($Contextual::Return::__RESULT__)
1254 5 10 if ($Contextual::Return::__RESULT__)
1259 0 15 if ref $rv ne 'SCALAR' and ref $rv ne 'OBJ'
1263 1 14 if ($attrs->{'FIXED'}) { }
14 0 elsif (not $attrs->{'ACTIVE'}) { }
1272 1 8 if ($attrs->{'STRICT'})
1274 0 1 if (my $recover = $attrs->{'RECOVER'}) { }
1282 1 7 if ($attrs->{'FIXED'})
1297 12 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
1302 1 14 if (my $recover = $attrs->{'RECOVER'}) { }
0 14 elsif ($@) { }
1303 1 0 unless ($Contextual::Return::__RESULT__)
1312 5 10 if ($Contextual::Return::__RESULT__)
1317 0 15 if ref $rv ne 'ARRAY' and ref $rv ne 'OBJ'
1321 1 14 if ($attrs->{'FIXED'}) { }
14 0 elsif (not $attrs->{'ACTIVE'}) { }
1331 1 8 if $attrs->{'STRICT'}
1332 2 6 unless my $handler = $attrs->{$context}
1338 0 6 if (my $recover = $attrs->{'RECOVER'}) { }
0 6 elsif ($@) { }
1339 0 0 unless ($Contextual::Return::__RESULT__)
1348 0 6 if ($Contextual::Return::__RESULT__)
1352 1 5 if ($attrs->{'FIXED'}) { }
5 0 elsif (not $attrs->{'ACTIVE'}) { }
1361 1 0 if ($attrs->{'STRICT'})
1363 0 1 if (my $recover = $attrs->{'RECOVER'}) { }
1382 0 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
1388 1 14 if (my $recover = $attrs->{'RECOVER'}) { }
0 14 elsif ($@) { }
1389 1 0 unless ($Contextual::Return::__RESULT__)
1398 5 10 if ($Contextual::Return::__RESULT__)
1403 0 15 if ref $rv ne 'HASH' and ref $rv ne 'OBJ'
1407 1 14 if ($attrs->{'FIXED'}) { }
14 0 elsif (not $attrs->{'ACTIVE'}) { }
1416 0 1 if (my $recover = $attrs->{'RECOVER'}) { }
1432 0 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
1438 1 6 if (my $recover = $attrs->{'RECOVER'}) { }
0 6 elsif ($@) { }
1439 1 0 unless ($Contextual::Return::__RESULT__)
1448 2 5 if ($Contextual::Return::__RESULT__)
1453 0 7 if ref $rv ne 'CODE' and ref $rv ne 'OBJ'
1457 1 6 if ($attrs->{'FIXED'}) { }
6 0 elsif (not $attrs->{'ACTIVE'}) { }
1466 0 0 if (my $recover = $attrs->{'RECOVER'}) { }
1482 0 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
1488 1 6 if (my $recover = $attrs->{'RECOVER'}) { }
0 6 elsif ($@) { }
1489 1 0 unless ($Contextual::Return::__RESULT__)
1498 2 5 if ($Contextual::Return::__RESULT__)
1503 0 7 if ref $rv ne 'GLOB' and ref $rv ne 'OBJ'
1507 1 6 if ($attrs->{'FIXED'}) { }
6 0 elsif (not $attrs->{'ACTIVE'}) { }
1516 0 0 if (my $recover = $attrs->{'RECOVER'}) { }
1532 13 234 if (my $handler = $attrs->{'CLEANUP'})
1545 6 1 if (ref $invocant)
1557 1 1 if (ref $invocant)
1571 15 7 $AUTOLOAD =~ / .* :: (.*) /msx ? :
1578 8 14 if (my $context_handler = $attrs->{'METHOD'})
1583 0 8 if (my $recover = $attrs->{'RECOVER'}) { }
0 8 elsif ($@) { }
1584 0 0 unless ($Contextual::Return::__RESULT__)
1593 0 8 if ($Contextual::Return::__RESULT__)
1601 3 13 if (ref $matcher eq 'ARRAY') { }
8 5 elsif (not $requested_method =~ /$matcher/) { }
1603 1 2 unless grep {$requested_method =~ /$_/;} @{$matcher;}
1610 0 7 if (wantarray) { }
1615 0 0 if $@
1623 0 7 if $@
1634 51 0 unless my $handler = $attrs->{$context} or $attrs->{'STRICT'} and last handler
1640 0 10 if (my $recover = $attrs->{'RECOVER'}) { }
0 10 elsif ($@) { }
1641 0 0 unless ($Contextual::Return::__RESULT__)
1650 0 10 if ($Contextual::Return::__RESULT__)
1654 1 9 if ($attrs->{'FIXED'}) { }
9 0 elsif (not $attrs->{'ACTIVE'}) { }
1662 0 10 if (wantarray) { }
1665 0 0 unless $exception
1666 0 0 unless $exception =~ /$NO_SUCH_METHOD/
1671 6 4 unless $exception
1672 1 3 unless $exception =~ /$NO_SUCH_METHOD/
1675 0 3 if (my $recover = $attrs->{'RECOVER'}) { }
1685 0 5 if (my $recover = $attrs->{'RECOVER'}) { }
1710 3 0 unless $Contextual::Return::__RESULT__
1720 21 0 $_[0]{'RVALUE'} ? :
1722 21 0 unless $Contextual::Return::__RESULT__