File Coverage

blib/lib/Password/Policy/Exception.pm
Criterion Covered Total %
statement 13 16 81.2
branch n/a
condition 0 2 0.0
subroutine 7 8 87.5
pod 0 3 0.0
total 20 29 68.9


line stmt bran cond sub pod time code
1             package Password::Policy::Exception;
2             $Password::Policy::Exception::VERSION = '0.06';
3 13     13   96254 use strict;
  13         84  
  13         539  
4 13     13   72 use warnings;
  13         28  
  13         1345  
5              
6             use overload
7 27     27   1121 '""' => sub { shift->error },
8 13     13   5855 'cmp' => \&_three_way_compare;
  13         17069  
  13         157  
9              
10              
11 27     27 0 327 sub new { bless {} => shift; }
12 1     1 0 11 sub error { return "An unspecified exception was thrown."; }
13 27     27 0 146747 sub throw { die shift->new; }
14              
15             sub _three_way_compare {
16 0     0     my $self = shift;
17 0   0       my $other = shift || '';
18 0           return $self->error cmp "$other";
19             }
20              
21             1;
22              
23             __END__