Branch Coverage

blib/lib/OOP/Perlish/Class/Accessor.pm
Criterion Covered Total %
branch 195 236 82.6


line true false branch
75 0 130 if (@values and ($self->readonly and $self->self->{'__initialized'}))
79 130 160 if (@values)
91 343 45 defined $self->self->{'___fields'}{$self->name}{'_Set'} ? :
101 0 260 if (defined $readonly and not exists $$self{'_readonly'})
104 260 0 unless $$self{'_readonly'}
115 89 1719 if ($type)
116 1 88 unless $self->__valid_type_lookup($type)
118 88 0 unless ($$self{'_Type'})
123 1807 0 if defined $$self{'_Type'}
136 305 1609 if (defined $class_self)
137 0 305 unless ref $class_self and blessed $class_self
140 305 0 if defined $class_self
142 1914 0 if defined $$self{'_class_self'}
153 89 1531 if (defined $name)
156 1620 0 if defined $$self{'_name'}
167 8 61 if (defined $required)
170 25 44 if defined $$self{'_required'}
181 10 20 if (@values and not $self->default_is_set)
183 0 10 if (not defined $values[0] and scalar @values == 1)
189 30 0 if (defined $$self{'_default'})
203 2 60 if (defined $mutable)
207 8 54 if (defined $$self{'_mutable'})
231 273 0 if $self->__valid_type_lookup($type)
243 60 223 if (/REF/i)
245 54 6 unless ($self->mutable)
246 18 36 if (/HASH/ and ref $ref eq 'HASH')
250 15 21 if (/ARRAY/ and ref $ref eq 'ARRAY')
254 15 6 if (/SCALAR/ and ref $ref eq 'SCALAR')
261 17 206 if (/CODE/i)
264 21 185 if (/OBJECT/)
267 28 157 if (/HASH/)
268 28 0 if ref $ref eq 'HASH'
270 28 129 if (/ARRAY/)
271 28 0 if ref $ref eq 'ARRAY'
273 119 10 if (/SCALAR/)
274 119 0 if ref $ref eq 'SCALAR'
288 8 173 if (/^REF/)
291 6 167 if (/CODE/i)
294 4 163 if (/GLOB/)
297 3 160 if (/REGEXP/i)
300 17 143 if (/OBJECT/)
303 32 111 if (/HASH/)
306 26 85 if (/ARRAY/)
309 85 0 if (/SCALAR/)
323 45 410 if ($validator and ref $validator) { }
325 11 34 if (/CODE/i)
328 34 0 if (/REGEXP/i)
346 2 53 if ($classes)
347 0 2 unless ref $classes
350 14 41 if defined $$self{'_Object_Classes'}
360 6 54 if ($interfaces)
361 0 6 unless ref $interfaces
364 24 36 if defined $$self{'_Object_Interfaces'}
374 4 54 if ($classes)
375 0 4 unless ref $classes
378 28 30 if defined $$self{'_Object_Implements'}
405 406 229 if (exists $valid_types_map{$type}) { }
228 1 elsif (exists $valid_types_lut{$type}) { }
423 48 10 unless exists $$self{'_default'} and $self->default_is_set
428 5 5 unless (@valid_values)
429 5 0 @orig_values ? :
443 130 0 if (@values and not $self->readonly && $self->self->{'__initialized'})
446 0 130 if (not defined $values[0] and scalar @values == 1)
450 30 100 unless $self->__validate(@values)
462 36 41 if ($self->type =~ /REF/) { }
9 32 elsif ($self->type eq 'SCALAR') { }
481 208 82 if ($self->is_set == 1) { }
67 15 elsif ($self->is_set == 0) { }
10 5 elsif ($self->is_set == -1 and not $self->default_is_set) { }
5 0 elsif ($self->default_is_set) { }
482 0 208 if (not defined $self->self->{'___fields'}{$self->name}{'_Value'}) { }
495 0 5 unless defined $self->default
509 2 47 unless ref $thing
510 0 47 unless blessed $thing
512 6 41 if ($self->object_isa)
514 2 4 unless $thing->isa($class)
517 9 36 if ($self->object_can)
519 3 14 unless $thing->can($method)
522 12 30 if ($self->implements)
524 4 8 unless $self->__validate_class_implementation($class, $thing)
540 0 12 if (scalar keys %{'::' . $class . '::';} == 0)
542 0 0 if "$@"
552 6 6 if ($class_ref->can('_all_methods')) { }
558 0 12 unless @interfaces
561 4 272 unless $thing->can($method)
573 49 53 if ($self->type eq 'OBJECT') { }
574 11 38 unless $self->__validate_obj_type($thing)
577 15 38 unless ref $thing eq $self->base_type
591 63 20 if (ref $values[0] and scalar @values == 1 and not $self->type =~ /(?:^REF|ARRAY)/)
592 17 46 unless $self->__validate_ref_type($values[0])
595 39 214 if ($self->type =~ /REF|CODE|REGEXP|OBJECT/ and not $self->type =~ /(?:^REF|SCALAR|ARRAY|HASH)/)
596 9 30 unless $self->__validate_ref_type($values[0]) and scalar @values == 1
600 2 6 unless scalar @values == 1 and ref $values[0]
8 236 if (/^REF/)
601 0 34 unless scalar @values % 2 == 0 or ref $values[0] eq 'HASH'
34 208 if (/HASH/)
602 4 130 unless scalar @values == 1
134 108 if (/SCALAR/)
603 0 2 unless scalar @values == 1 and ref $values[0] eq 'GLOB'
2 236 if (/GLOB/)
616 0 270 unless @values
617 32 238 unless $self->__validate_type(@values)
619 172 66 if (defined $self->validator) { }
636 45 213 if (scalar @input == 1 and ref $input[0] and ref $input[0] eq $self->base_type) { }
660 29 5 if ($self->can($possible_method))
665 5 0 if ($self->can($possible_method))
683 0 14 unless keys %args
685 21 13 if ($val =~ /($re)/)
689 9 5 if scalar keys %args == scalar keys %valid_args
706 0 10 unless @args
708 0 30 unless defined $_
709 17 13 if (/($re)/x)
713 5 5 if scalar @args == scalar @valid_args
730 0 92 unless defined $arg
731 87 5 if ($arg =~ /($re)/)
733 0 87 unless defined $valid_arg
750 0 4 unless defined $obj
751 2 2 if ref($obj) =~ /$regexp/