Branch Coverage

blib/lib/Hash/Wrap.pm
Criterion Covered Total %
branch 202 252 80.1


line true false branch
49 172 58 defined $_->[0] && defined $_->[1] ? :
115 0 if defined $candidate and 2 == grep({defined $_->[0] && defined $_->[1] ? $_->[0] eq $_->[1] : 1;} [$reftype->[0], builtin::reftype($candidate)], [$reftype->[1], builtin::reftype($$candidate)])
67 0 90 if $@
83 0 4 if $@
94 0 75 unless builtin::blessed($object)
97 4 71 if (exists $REGISTRY{$hash_class}{'predicate_template'} and $key =~ /^has_(.*)/)
104 8 63 unless $REGISTRY{$hash_class}{'validate'}->($object, $key)
113 0 58 unless defined $class
115 26 32 unless (exists $self->{$key})
117 12 14 if (exists $REGISTRY{$class}{'methods'}{$key})
138 4 64 unless @imports
143 5 67 if (not ref $args) { }
0 67 elsif ('HASH' ne ref $args) { }
145 1 4 unless grep {/$args/;} @EXPORT
152 0 0 unless grep {/$args/;} @EXPORT
160 1 3 if not !$args->{'-base'} and exists $args->{'-class'}
165 14 56 unless exists $args->{'-as'}
170 69 1 if (defined $name)
172 9 60 if (defined(my $reftype = builtin::reftype($name))) { }
20 40 elsif ($name eq '-return') { }
173 1 0 if $reftype ne "SCALAR" and $reftype ne "VSTRING" and $reftype ne "REF" and $reftype ne "GLOB" and $reftype ne "LVALUE" and $reftype ne "REGEXP"
190 3 66 if ($args->{'-base'}) { }
192 0 3 if $args->{'-as_return'}
194 3 0 unless exists $args->{'-new'}
200 60 1 if (defined $name)
202 20 38 if $args->{'-as_return'}
213 1 61 if (keys %$args)
228 24 45 if (exists $attr->{'-recurse'})
230 1 23 unless &Scalar::Util::looks_like_number($attr->{'-recurse'})
231 4 19 if $attr->{'-recurse'} == 0
234 52 16 if (not defined $attr->{'-class'}) { }
3 13 elsif ($attr->{'-class'} eq '-target' or $attr->{'-class'} eq '-caller') { }
239 108 0 defined $attr->{$_} ? :
246 1 2 if ref $name
253 7 60 if defined $REGISTRY{$class}
271 5 55 if ($attr->{'-lvalue'})
272 0 5 if ($] lt '5.016000') { }
274 0 0 if $attr->{'-lvalue'} < 0
282 7 53 if ($attr->{'-undef'})
287 14 46 if ($attr->{'-exists'})
288 13 1 $attr->{'-exists'} =~ /\A([^\W\d]\w*+)\z/ ? :
293 2 58 if ($attr->{'-defined'})
294 1 1 $attr->{'-defined'} =~ /\A([^\W\d]\w*+)\z/ ? :
299 5 55 if ($attr->{'-immutable'})
306 13 47 if ($attr->{'-recurse'})
314 7 6 --$attr->{'-recurse'} < 0 ? :
327 4 9 if ($attr->{'-copy'}) { }
329 3 1 if ($attr->{'-immutable'}) { }
365 10 3 --$attr->{'-recurse'} < 0 ? :
370 1 59 if ($attr->{'-predicate'})
447 13 47 keys %closures ? :
0 60 unless _compile_from_tpl(\$class_template, \%dict, keys %closures ? \%closures : ())
450 5 55 unless (not $attr->{'-new'})
451 0 5 $attr->{'-new'} =~ /\A([^\W\d]\w*+)\z/ ? :
455 16 44 if ($attr->{'-methods'})
458 1 15 unless "HASH" eq ref $methods
462 1 15 unless $mth =~ /\A([^\W\d]\w*+)\z/
466 1 14 unless "CODE" eq ref $code
479 1 56 if ($attr->{'-predicate'})
498 1 9 if exists $args->{'-copy'} and exists $args->{'-clone'}
509 5 59 if ($args->{'-as_method'}) { }
523 9 55 if ($args->{'-copy'}) { }
3 52 elsif (exists $args->{'-clone'}) { }
529 1 2 if ('CODE' eq ref $args->{'-clone'}) { }
550 8 56 if (defined(my $opts = $args->{'-immutable'} || undef)) { }
3 53 elsif (defined($opts = $args->{'-lockkeys'} || undef)) { }
554 1 7 if ("ARRAY" eq ref $opts)
570 2 1 if ('ARRAY' eq ref $args->{'-lockkeys'}) { }
1 0 elsif ($args->{'-lockkeys'}) { }
589 27 36 if ($args->{'-as_scalar_ref'} or $args->{'-as_return'})
622 7 56 if $args->{'-as_scalar_ref'}
645 14 203 if (defined $closures and %$closures)
656 0 217 if ($DEBUG)
662 14 203 exists $dict->{'closures'} ? :
669 14 203 if (@_ > 1) { }
675 1 35 unless builtin::blessed($self)
2 19 unless exists $self->{'a'}
0 17 if @_
1 18 unless builtin::blessed($self)
1 24 if @_
0 24 unless builtin::blessed($self)
3 18 if @_
1 14 if "HASH" ne builtin::reftype($hash)
0 9 if builtin::blessed($hash)
0 23 if "HASH" ne builtin::reftype($hash)
2 32 if builtin::blessed($hash)
1 25 if "HASH" ne builtin::reftype($hash)
3 37 if builtin::blessed($hash)
4 31 if "HASH" ne builtin::reftype($hash)
0 10 if builtin::blessed($hash)
0 8 if "HASH" ne builtin::reftype($hash)
2 6 if builtin::blessed($hash)
1 4 if "HASH" ne builtin::reftype($hash)
1 8 if builtin::blessed($hash)
0 8 if "HASH" ne builtin::reftype($hash)
1 6 if builtin::blessed($hash)
1 3 if "HASH" ne builtin::reftype($hash)
0 1 if builtin::blessed($hash)
0 1 if "HASH" ne builtin::reftype($hash)
0 1 if builtin::blessed($hash)
0 1 if "HASH" ne builtin::reftype($hash)
0 1 if builtin::blessed($hash)
0 1 unless builtin::blessed($self)
0 3 unless exists $self->{'answer'}
0 3 if @_
0 3 unless builtin::blessed($self)
0 3 unless exists $self->{'answer'}
0 1 if @_
0 1 unless builtin::blessed($self)
0 1 unless exists $self->{'a'}
0 1 if @_
0 1 unless builtin::blessed($self)
0 1 unless exists $self->{'a'}
0 1 if @_
0 1 unless builtin::blessed($self)
0 1 unless exists $self->{'a'}
0 1 if @_
0 1 unless builtin::blessed($self)
0 1 unless exists $self->{'a'}
0 1 if @_
0 1 unless builtin::blessed($self)
682 217 2469 unless defined $work
686 527 2519 if (defined $1) { }
692 2444 82 if (defined $v) { }
693 124 2345 if "ARRAY" eq ref $v
697 2 2459 if $work->{'loop'}{$key}++