Branch Coverage

blib/lib/MooX/Struct.pm
Criterion Covered Total %
branch 83 90 92.2


line true false branch
37 1 6 unless ref $_[0]
51 31 38 if (@_ == 1 and ref $_[0] eq 'ARRAY' or @_ == 1 and &ArrayLike()->check($_[0]) and not $HashLike->check($_[0])) { }
1 39 elsif (@_ == 1 and ref $_[0] ne 'HASH' and $HashLike->check($_[0])) { }
57 1 30 unless @fields >= @values
89 2 2 if ref $invocant
93 4 1 unless $args[0] =~ /^-(.+)$/
98 4 0 if ref $args[0] eq 'SCALAR'
104 2 2 unless ref $invocant
117 0 0 if ($Data::Printer::VERSION lt '0.90') { }
129 0 0 if (grep /\n/, @values)
191 26 1 unless $ENV{'PERL_MOOX_STRUCT_TRACE'}
210 69 4 unless $o->[0] eq '-class'
211 1 3 &ArrayRef()->check($o->[1]) ? :
214 35 4 unless defined $klass
217 2 37 if ($self->trace)
231 13 7 if ($name eq '-extends' or $name eq '-isa') { }
2 5 elsif ($name eq '-with') { }
4 1 elsif ($name eq '-class') { }
235 6 7 exists $self->class_map->{$_} ? :
241 1 12 if ($self->trace)
249 12 1 $_->can('FIELDS') ? :
257 1 1 if ($self->trace)
289 6 73 if ($self->trace)
295 3 3 if ($self->flags->{'deparse'})
312 2 53 $self->flags->{'rw'} ? :
1 47 &HashLike()->check($val) ? :
7 48 &ArrayLike()->check($val) ? :
319 3 52 if ($name =~ /^(.+)\!$/)
325 2 53 if ($name =~ /^\@(.+)/) { }
2 51 elsif ($name =~ /^\%(.+)/) { }
15 36 elsif ($name =~ /^\+(.+)/) { }
19 17 elsif ($name =~ /^\$(.+)/) { }
339 13 2 unless $spec{'required'}
357 3 52 if ($self->trace)
361 2 1 if (&TypeTiny()->check($sanespec{'isa'}))
371 0 3 if ($self->flags->{'deparse'} and &CodeRef()->check($spec->{'isa'}))
400 3 75 if &CodeLike()->check($val)
401 20 55 if $name =~ /^-/
411 39 79 if (ref $proto)
417 12 66 if $_->[0] eq '-extends'
420 24 14 if not $seen_extends and $self->base->can('FIELDS')
423 38 0 if defined $subname
426 25 92 if @_
443 1 34 unless defined $details
458 21 4 unless $self->flags->{'retain'}