Branch Coverage

blib/lib/Attribute/Handlers.pm
Criterion Covered Total %
branch 62 100 62.0


line true false branch
13 1 73 if $symcache{join $;, $pkg, $ref}
18 0 4984 unless ref \$sym eq 'GLOB'
20 39 4945 if *{$sym;}{$type} and *{$sym;}{$type} == $ref
55 0 5 unless $class eq 'Attribute::Handlers'
58 1 0 if ($cmd =~ /^autotie((?:ref)?)$/) { }
59 0 1 $1 ? :
61 0 1 unless ref $mapping eq 'HASH'
65 0 3 unless $attr =~ /$qual_id/ and $tieclass =~ /$qual_id/ and eval "use base q\000$tieclass\000; 1"
68 0 3 if ($tieclass->isa('Exporter'))
73 1 2 unless $attr =~ /::/
74 0 3 unless eval qq[\n\t sub $attr : ATTR(VAR) {\n\t\t\tmy (\$ref, \$data) = \@_[2,4];\n\t\t\tmy \$was_arrayref = ref \$data eq 'ARRAY';\n\t\t\t\$data = [ \$data ] unless \$was_arrayref;\n\t\t\tmy \$type = ref(\$ref)||"value (".(\$ref||"").")";\n\t\t\t (\$type eq 'SCALAR')? tie \$\$ref,'${tieclass}',$tiedata\n\t\t\t:(\$type eq 'ARRAY') ? tie \@\$ref,'${tieclass}',$tiedata\n\t\t\t:(\$type eq 'HASH') ? tie %\$ref,'${tieclass}',$tiedata\n\t\t\t: die "Can't autotie a \$type\n"\n\t } 1\n\t ]
1 0 unless $was_arrayref
0 0 $type eq 'HASH' ? :
0 0 $type eq 'ARRAY' ? :
1 0 $type eq 'SCALAR' ? :
0 1 unless $was_arrayref
0 0 $type eq 'HASH' ? :
1 0 $type eq 'ARRAY' ? :
0 1 $type eq 'SCALAR' ? :
0 1 unless $was_arrayref
1 0 $type eq 'HASH' ? :
0 1 $type eq 'ARRAY' ? :
0 1 $type eq 'SCALAR' ? :
117 0 21 unless $lastattr{'ref'}
118 0 21 unless my $sym = findsym(@lastattr{'pkg', 'ref'})
121 0 21 if $^W and not $name =~ /[A-Z]/
131 0 0 if $Attribute::Handlers::AUTOLOAD =~ /::DESTROY$/
133 0 0 unless $Attribute::Handlers::AUTOLOAD =~ /_ATTR_(.*?)_(.*)/
142 0 76 if _delayed_name_resolution
146 0 77 unless my($attr, $data) = /^([a-z_]\w*)(?:[(](.*)[)])?$/is
147 21 56 if ($attr eq 'ATTR') { }
151 2 19 if $data =~ s/\s*,?\s*(BEGIN)\s*,?\s*//
153 1 20 if $data =~ s/\s*,?\s*(INIT)\s*,?\s*//
155 1 20 if $data =~ s/\s*,?\s*(END)\s*,?\s*//
159 16 5 if $data =~ s/\s*,?\s*(CHECK)\s*,?\s*// or not keys %{$phase{$ref};}
161 0 21 if keys %lastattr
164 0 21 unless $validtype{$data}
167 21 0 unless _delayed_name_resolution
172 2 54 unless $handler
176 124 92 if $global_phases{$gphase} <= $global_phase
179 35 19 if ($global_phase != 0) { }
185 1 34 if $phase{$handler}{'END'}
194 2 74 if defined $_
209 128 53 unless $$handlerphase{$phase}
214 0 34 $type eq 'CODE' ? :
216 45 8 if (not $raw and defined $data)
217 45 0 if ($data ne '') { }
220 43 2 unless $@
225 19 34 ref $sym eq 'GLOB' ? :
239 0 4 if _delayed_name_resolution