Branch Coverage

blib/lib/Role/Basic.pm
Criterion Covered Total %
branch 82 94 87.2


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))
356 938 234 unless my $code = _get_valid_method($target, $item)
372 10 1162 if ref $item
373 392 770 unless my $code = *$item{'CODE'}
375 0 770 unless my $source = _sub_package($code)
387 546 224 unless ($is_valid)
389 10 0 if $target->DOES($role)
392 224 536 $is_valid ? :
400 1022 0 if ($stash and $stash->can('NAME')) { }
407 0 1022 if (my $error = $@)
418 115 6 if (exists $$stash{'requires'})
422 58 57 unless (exists $INC{$package})
429 4 117 if $@
431 116 1 if $IS_ROLE{$role}
434 1 0 if (not $requires or $class ne _sub_package($requires))