Branch Coverage

blib/lib/Mic/Assembler.pm
Criterion Covered Total %
branch 108 138 78.2


line true false branch
31 49 0 unless $cls_stash->get_symbol('%__meta__')
48 0 51 unless $pkg ne $spec->{'name'}
57 0 51 unless $meta->{'has'}
69 51 0 if @_ > 0
86 1 206 if ($is_classmethod->{$sub})
89 1 206 if ($type)
100 46 5 unless ($stash->has_symbol('%__meta__'))
104 0 51 unless ($stash->has_symbol('%__meta__'))
118 51 51 if ($type eq 'interface' and ref $spec->{$type} eq 'HASH')
138 48 3 if ref $spec->{'interface'}
142 3 1 if (my $methods = $Mic::Spec_for{$spec->{'interface'}}{'interface'}) { }
147 0 1 if $count > 0
159 51 2 unless ($interfaces)
167 0 2 if $super eq $spec->{'name'}
170 0 2 unless my $declared_interface = $Mic::Spec_for{$super}{'interface'}
180 51 2 unless defined $x
181 1 1 ref $x eq 'ARRAY' ? :
188 2 12 if (exists $h1->{$k}) { }
189 2 0 if (ref $h1->{$k} eq 'HASH' and ref $h2->{$k} eq 'HASH')
205 1 203 unless defined $spec->{'implementation'}{'methods'}{$method}
209 0 50 unless $count > 0
215 0 51 if $self->{'config_file_read'}
218 49 2 unless my $config_file = $ENV{'MIC_CONTRACTS'}
234 2 6 unless ($r)
236 0 2 $spec->{'interface_name'} ? :
237 0 2 unless defined wantarray
238 2 0 wantarray ? :
249 0 94 unless ($f)
251 0 0 unless defined wantarray
252 0 0 wantarray ? :
260 15 52 if (not $spec->{'implementation'}{'methods'}{$meta->{'reader'}} and $meta->{'reader'} and $$in_interface{$meta->{'reader'}})
271 1 66 if (not $spec->{'implementation'}{'methods'}{$meta->{'property'}} and $meta->{'property'} and $$in_interface{$meta->{'property'}})
275 0 1 if $] lt '5.016'
284 1 66 if (not $spec->{'implementation'}{'methods'}{$meta->{'writer'}} and $meta->{'writer'} and $$in_interface{$meta->{'writer'}})
299 73 307 unless $in_interface->{$name}
325 45 6 unless $Mic::Contracts_for{$spec->{'name'}}{'invariant'}
331 0 6 unless my $inv_hash = !ref($spec->{'interface'}) && $Mic::Spec_for{$spec->{'interface'}}{'interface_meta'}{'invariant'} || $spec->{'interface_meta'}{'invariant'}
335 638 142 if (caller 1)[0] eq $spec->{'name'}
339 4 138 unless &$sub(@_)
352 7 249 if (defined $Mic::Contracts_for{$spec->{'name'}}{'pre'} and not $Mic::Contracts_for{$spec->{'name'}}{'pre'})
359 229 20 unless my $pre_cond_hash = $spec->{'interface_meta'}{$type}{$name}{'require'}
364 2 27 unless &$sub(@_)
374 214 42 unless $Mic::Contracts_for{$spec->{'name'}}{'post'}
378 24 18 unless my $post_cond_hash = $spec->{'interface_meta'}{$type}{$name}{'ensure'}
388 24 6 if ($type eq 'object')
394 6 24 if ($type eq 'class' and $name eq $constructor_spec->{'name'})
401 4 39 unless &$sub(@invocant, @old, $results_to_check, @_)
404 19 7 unless defined wantarray
405 1 6 wantarray ? :
414 205 0 unless my $overload_type = $spec->{'interface_meta'}{$type}{$name}{'overloads'}
420 0 0 if $@
448 6 47 if (my $builder = $impl_pkg->can('BUILD'))
457 47 6 unless exists $spec->{'invariant_guard'}
496 16 51 if ($meta->{'handles'})
499 15 1 if (ref $meta->{'handles'} eq 'ARRAY') { }
1 0 elsif (ref $meta->{'handles'} eq 'HASH') { }
508 0 55 if (defined $spec->{'implementation'}{'methods'}{$meth}) { }
517 212 102 if (wantarray) { }
87 15 elsif (defined wantarray) { }
537 0 120 unless (ref $spec->{'interface'})
540 0 0 if $s = $Mic::Spec_for{$spec->{'interface'}}{'constructor'}
553 50 1 if (not exists $spec->{'class_methods'}{$sub_name})
558 19 34 if (scalar @_ == 1) { }
2 32 elsif (scalar @_ > 1) { }
567 19 34 ref $arg eq 'HASH' ? :
573 0 19 if ($dup)
576 18 1 if ($attr)
604 42 27 ref $meta->{'default'} eq 'CODE' ? :
1 69 $init->{$attr} ? :