Branch Coverage

blib/lib/MooX/Struct.pm
Criterion Covered Total %
branch 82 90 91.1


line true false branch
36 0 6 unless ref $_[0]
45 30 37 if (@_ == 1 and ref $_[0] eq 'ARRAY' or @_ == 1 and &ArrayLike()->check($_[0]) and not $HashLike->check($_[0])) { }
1 37 elsif (@_ == 1 and ref $_[0] ne 'HASH' and $HashLike->check($_[0])) { }
51 1 29 unless @fields >= @values
83 2 2 if ref $invocant
87 4 1 unless $args[0] =~ /^-(.+)$/
92 4 0 if ref $args[0] eq 'SCALAR'
98 2 2 unless ref $invocant
111 0 0 if ($Data::Printer::VERSION lt '0.90') { }
123 0 0 if (grep /\n/, @values)
185 26 1 unless $ENV{'PERL_MOOX_STRUCT_TRACE'}
204 69 4 unless $o->[0] eq '-class'
205 1 3 &ArrayRef()->check($o->[1]) ? :
208 35 4 unless defined $klass
211 2 37 if ($self->trace)
225 13 7 if ($name eq '-extends' or $name eq '-isa') { }
2 5 elsif ($name eq '-with') { }
4 1 elsif ($name eq '-class') { }
229 6 7 exists $self->class_map->{$_} ? :
235 1 12 if ($self->trace)
243 12 1 $_->can('FIELDS') ? :
251 1 1 if ($self->trace)
283 6 73 if ($self->trace)
289 3 3 if ($self->flags->{'deparse'})
306 2 53 $self->flags->{'rw'} ? :
1 47 &HashLike()->check($val) ? :
7 48 &ArrayLike()->check($val) ? :
313 3 52 if ($name =~ /^(.+)\!$/)
319 2 53 if ($name =~ /^\@(.+)/) { }
2 51 elsif ($name =~ /^\%(.+)/) { }
15 36 elsif ($name =~ /^\+(.+)/) { }
19 17 elsif ($name =~ /^\$(.+)/) { }
333 13 2 unless $spec{'required'}
351 3 52 if ($self->trace)
355 2 1 if (&TypeTiny()->check($sanespec{'isa'}))
365 0 3 if ($self->flags->{'deparse'} and &CodeRef()->check($spec->{'isa'}))
394 3 75 if &CodeLike()->check($val)
395 20 55 if $name =~ /^-/
405 39 78 if (ref $proto)
411 12 66 if $_->[0] eq '-extends'
414 24 14 if not $seen_extends and $self->base->can('FIELDS')
417 38 0 if defined $subname
420 25 91 if @_
437 1 34 unless defined $details
452 21 4 unless $self->flags->{'retain'}