Branch Coverage

blib/lib/Role/Basic.pm
Criterion Covered Total %
branch 83 96 86.4


line true false branch
30 7 39 if $class_or_role eq $role
31 29 10 exists $HAS_ROLES{$class_or_role}{$role} ? :
33 56 75 if (1 == @_ and 'with' eq $_[0]) { }
2 73 elsif (2 == @_ and 'allow' eq $_[0]) { }
2 71 elsif (@_) { }
75 168 115 unless my $requirements = $REQUIRED_BY{$role}
81 0 13 unless $IS_ROLE{$role}
88 113 17 unless $HAS_ROLES{$target}
94 22 0 unless ($seen{$role_name})
104 2 83 if ($HAS_ROLES{$target})
120 36 81 if ref $roles[0]
134 17 91 if (my $roles = $HAS_ROLES{$role})
145 33 75 if ($IS_ROLE{$target})
158 1 21 if $is_applied{$contained_role}
170 106 20 if (my $methods = $PROVIDES{$contained_role})
191 99 37 if 1 == @$sources
206 13 24 if (@sources > 1 and $target ne _sub_package($target->can($method)))
213 10 64 if (my $errors = join("\n", @errors))
223 21 43 if $IS_ROLE{$target}
226 20 17 unless ($target->can($method))
232 9 34 if (@errors)
262 16 11 unless ($is_loaded)
263 0 16 if (exists $code_for->{$new_method} and not $is_excluded->{$new_method}) { }
276 5 22 if (exists $stash->{$new_method})
283 30 150 if ($is_excluded->{$method})
284 27 3 unless ($was_aliased{$method})
291 21 132 if (exists $target_methods->{$method})
292 1 20 if ($ENV{'PERL_ROLE_OVERRIDE_DIE'})
297 0 20 if ($ENV{'PERL_ROLE_OVERRIDE_WARN'})
320 17 97 unless ref $excludes
328 0 114 unless ("ARRAY" eq ref $excludes)
335 0 114 unless ("HASH" eq ref $aliases)
341 0 114 if (my $unknown = join(", ", keys %$role_modifiers))
357 938 234 unless my $code = _get_valid_method($target, $item)
373 1162 10 ref \$item eq 'GLOB' ? :
0 1172 ref $item eq 'CODE' ? :
374 402 770 unless defined $code
376 0 770 unless my $source = _sub_package($code)
388 546 224 unless ($is_valid)
390 10 0 if $target->DOES($role)
393 224 536 $is_valid ? :
401 1022 0 if ($stash and $stash->can('NAME')) { }
408 0 1022 if (my $error = $@)
419 115 6 if (exists $stash->{'requires'})
423 58 57 unless (exists $INC{$package})
430 4 117 if $@
432 116 1 if $IS_ROLE{$role}
435 1 0 if (not $requires or $class ne _sub_package($requires))