Branch Coverage

blib/lib/Object/Hybrid.pm
Criterion Covered Total %
branch 120 312 38.4


line true false branch
604 0 15 ref $primitive ? :
631 0 15 ref $$type{'reftype'} ? :
15 0 if $$type{'reftype'} or croak(q[No 'reftype' parameter specified])
638 7 8 if (not $$type{'tieable'}) { }
642 0 8 $$type{'mutable'} ? :
643 0 8 if $$type{'caller'}
657 0 2 ref $_[0] eq 'ARRAY' ? :
0 2 ref $_[0] eq 'HASH' ? :
0 2 !@_ ? :
0 2 @_ > 1 ? :
667 4 2 unless exists $$opt{$list}
668 0 2 unless ref $$opt{$list} eq 'ARRAY'
676 2 0 ref $$opt{'feature'} eq 'ARRAY' ? :
677 2 0 if ($feature eq 'promote')
680 0 2 if ($feature eq 'autobox') { }
0 2 elsif ($feature eq 'autopromote') { }
0 2 elsif ($feature eq 'SAFE') { }
707 0 0 unless $_[0]->can($$autoload)
715 2 0 if ($$opt{'export'})
717 0 2 unless $$opt{'export'}
718 2 0 if ($symbol eq 'promote') { }
727 0 2 if (@symbols or @{(ref $self || $self) . '::EXPORT';} or @{'Object::Hybrid::EXPORT';})
732 0 0 unless Exporter::export_to_level(1, $self, @symbols)
737 0 2 if (@goto)
753 82 31 (my $primitive_tied = _ref_tied($_[1])) ? :
756 47 66 if @_ == 2
760 0 107 unless @_ > 1
767 77 30 @_ % 2 ? :
0 107 ref $_[2] eq 'HASH' ? :
0 107 ref $_[1] eq 'HASH' ? :
774 71 36 unless %$args
778 94 7 $$args{'tieable'} || $primitive_is_tied ? :
779 0 101 $$args{'mutable'} ? :
780 0 101 $$args{'caller'} ? :
781 7 0 unless $hybrid_is_tieable or $hybrid_is_mutable or $hybrid_is_caller
791 0 15 unless ref $primitive
792 0 5 unless not blessed $primitive or $$args{'rebless'} or $HybridClass{ref $primitive} and delete $Object::Hybrid::Cache4object{refaddr $primitive}, 1
800 0 15 unless $class4type{$primitive_reftype}
811 9 6 if ($class) { }
812 9 0 unless ($self->Class->is($class))
815 3 6 unless @{$frontclass . '::ISA';}
824 0 15 $bless ? :
828 3 12 if $no_opt and $class eq ''
829 7 8 if $no_opt
834 0 15 if exists $$args{'shadow'}
842 0 12 unless ref $_[1]
848 0 0 reftype($_[1]) eq 'GLOB' ? :
0 0 reftype($_[1]) eq 'ARRAY' ? :
0 0 reftype($_[1]) eq 'SCALAR' ? :
12 0 reftype($_[1]) eq 'HASH' ? :
0 12 unless my $tied = reftype($_[1]) eq 'HASH' ? CORE::tie(%{$_[1];}, @_[2 .. $#_]) : (reftype($_[1]) eq 'SCALAR' ? CORE::tie(${$_[1];}, @_[2 .. $#_]) : (reftype($_[1]) eq 'ARRAY' ? CORE::tie(@{$_[1];}, @_[2 .. $#_]) : (reftype($_[1]) eq 'GLOB' ? CORE::tie(*{$_[1];}, @_[2 .. $#_]) : undef)))
858 13 4 if $Loaded{$_[1]}
863 4 0 !ref($type) ? :
0 4 unless my $sub_type = !ref($type) ? $self->can("LOAD_$type") : croak("Bad type $type")
869 0 4 if ref $class eq 'CODE'
870 0 4 if ref $class
871 0 4 unless not $class or eval $class, !$@
878 0 0 unless ref $_[0]
890 4 0 reftype($_[0]) eq 'GLOB' ? :
0 4 reftype($_[0]) eq 'ARRAY' ? :
0 4 reftype($_[0]) eq 'SCALAR' ? :
109 4 reftype($_[0]) eq 'HASH' ? :
897 0 0 unless ref $_[0]
898 0 0 if $_[0] =~ /=(\w+)/
904 0 0 unless ref $_[0]
905 0 0 if exists $class4type{ref $_[0]}
906 0 0 if defined $_[1] and not $_[0]->isa($_[1])
912 59 76 $_[0] =~ /[A-Z]/ ? :
918 2 5 ref $_[0] eq 'HASH' ? :
922 0 56 unless ref $$subs{$method} eq 'CODE' or ref($$subs{$method} = $$subs{$$subs{$method}}) eq 'CODE'
948 0 0 if @_ > 1
953 0 2 unless @_ > 1
964 8 0 unless $Object::Hybrid::Portable and not +(split(/::/, $Object::Hybrid::BASE::AUTOLOAD, 0))[-1] =~ /[A-Z]/ and return
1171 0 4 unless $type =~ /(HASH|ARRAY|GLOB|SCALAR)/ and my $reftype = $1
1177 0 4 $type =~ /MUTABLE/ ? :
1178 0 4 $type =~ /CALLER/ ? :
1179 0 0 $reftype eq 'SCALAR' ? :
2 0 $reftype eq 'GLOB' ? :
0 2 $reftype eq 'ARRAY' ? :
2 2 $reftype eq 'HASH' ? :
1186 2 2 unless $type eq $SUBCLASS_REPLACE
1195 3 0 unless $sub_method ||= (tied *{$_[0];} || $_[0])->UNIVERSAL::can($can_method)
0 3 if $err or $@
0 31 $Object::Hybrid::CALLER ? :
31 50 if @$cache
50 0 if $swap = tied *{$_[0];}
44 6 if $swap and $sub_method = $_[0]->UNIVERSAL::can($METHOD) || $_[0]->UNIVERSAL::can($METHOD2)
6 0 if $swap
2 4 if $sub_method = 'Object::Hybrid::GLOB'->UNIVERSAL::can($METHOD) || 'Object::Hybrid::GLOB'->UNIVERSAL::can($METHOD2)
0 0 unless $METHOD_is_lc and $Object::Hybrid::Portable and return
0 46 unless $sub_method ne $SUB_METHOD
1 28 $METHOD eq 'can' ? :
4 130 unless $sub_method ||= (tied %{$_[0];} || $_[0])->UNIVERSAL::can($can_method)
0 134 if $err or $@
0 0 $Object::Hybrid::CALLER ? :
0 42 if @$cache
36 6 if $swap = tied %{$_[0];}
36 6 if $swap and $sub_method = $_[0]->UNIVERSAL::can($METHOD) || $_[0]->UNIVERSAL::can($METHOD2)
0 6 if $swap
6 0 if $sub_method = 'Object::Hybrid::HASH'->UNIVERSAL::can($METHOD) || 'Object::Hybrid::HASH'->UNIVERSAL::can($METHOD2)
0 0 unless $METHOD_is_lc and $Object::Hybrid::Portable and return
0 42 unless $sub_method ne $SUB_METHOD
1 1 $METHOD eq 'can' ? :
0 0 $@ ? :
0 0 $@ ? :
0 0 wantarray ? :
0 0 $@ ? :
0 0 $@ ? :
0 0 wantarray ? :
0 0 $@ ? :
0 0 $@ ? :
0 0 wantarray ? :
0 0 $@ ? :
0 0 $@ ? :
0 0 wantarray ? :
0 0 if $METHOD_is_lc and $Object::Hybrid::Portable
0 0 unless ref $_[0]
0 0 $type eq 'GLOB' ? :
0 0 $type eq 'ARRAY' ? :
0 0 $type eq 'SCALAR' ? :
0 0 $type eq 'HASH' ? :
0 6 unless @_ >= 3
0 0 @_ >= 4 ? :
6 0 @_ == 3 ? :
0 6 unless not $@
0 0 $@ ? :
0 0 $@ ? :
0 0 wantarray ? :
0 0 $@ ? :
0 0 $@ ? :
0 0 wantarray ? :
0 0 $@ ? :
0 0 $@ ? :
0 0 wantarray ? :
0 0 $@ ? :
0 0 $@ ? :
0 0 wantarray ? :
0 0 if $METHOD_is_lc and $Object::Hybrid::Portable
0 0 unless eval { do { $fh = *$fh } }, !$@
0 0 if ($fh eq '') { }
0 0 if @open_args
6 4 if defined $_[0]->FILENO
0 10 @_ == 2 ? :
0 0 unless ref $_[0]
0 0 $type eq 'GLOB' ? :
0 0 $type eq 'ARRAY' ? :
0 0 $type eq 'SCALAR' ? :
0 0 $type eq 'HASH' ? :
0 0 unless @_ > 1
0 2 unless @_ > 1
0 0 unless @_ >= 3
0 0 unless not $@
0 0 unless not $@
0 0 if ($_[1] =~ /^-\w$/) { }
0 0 unless $_[0]->can('TIEGLOB')
1196 0 4 unless not $@