File Coverage

lib/Perlmazing/Perlmazing/find_parent_classes.pm
Criterion Covered Total %
statement 20 20 100.0
branch 5 8 62.5
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 28 32 87.5


line stmt bran cond sub pod time code
1 1     1   11 use Perlmazing;
  1         2  
  1         7  
2            
3             sub main {
4 3     3 0 6 my @res;
5 3         7 my $seen = {};
6 3         6 for my $class (@_) {
7 2 50       7 next if $seen->{$class};
8 2         4 $seen->{$class} = 1;
9 2 50       8 $class = ref($class) if is_blessed $class;
10 1     1   9 no strict 'refs';
  1         2  
  1         183  
11 2         5 push @res, $class;
12 2         3 for my $i (main(@{"$class\::ISA"})) {
  2         14  
13 1 50       4 next if $seen->{$i};
14 1         2 $seen->{$i} = 1;
15 1         2 push @res, $i;
16             }
17             }
18 3 100       8 push @res, 'UNIVERSAL' unless caller eq __PACKAGE__;
19 3         12 @res;
20             }
21            
22             1;