File Coverage

blib/lib/Test/Deep/Isa.pm
Criterion Covered Total %
statement 23 23 100.0
branch 2 2 100.0
condition n/a
subroutine 8 8 100.0
pod 0 4 0.0
total 33 37 89.1


line stmt bran cond sub pod time code
1 2     2   17 use strict;
  2         5  
  2         94  
2 2     2   13 use warnings;
  2         4  
  2         208  
3              
4             package Test::Deep::Isa 1.205;
5              
6 2     2   1174 use Test::Deep::Cmp;
  2         8  
  2         11  
7 2     2   17 use Scalar::Util;
  2         4  
  2         591  
8              
9             sub init
10             {
11 6     6 0 17 my $self = shift;
12              
13 6         15 my $val = shift;
14 6         101 $self->{val} = $val;
15             }
16              
17             sub descend
18             {
19 6     6 0 13 my $self = shift;
20 6         10 my $got = shift;
21              
22             return Scalar::Util::blessed($got)
23             ? $got->isa($self->{val})
24 6 100       42 : ref($got) eq $self->{val};
25             }
26              
27             sub diag_message
28             {
29 2     2 0 4 my $self = shift;
30              
31 2         5 my $where = shift;
32              
33 2         7 return "Checking class of $where with isa()";
34             }
35              
36             sub renderExp
37             {
38 2     2 0 4 my $self = shift;
39              
40 2         8 return "blessed into or ref of type '$self->{val}'";
41             }
42              
43             1;
44              
45             __END__