blib/lib/Salvation/TC/Type/Number/Integer.pm

filter: Statementstmt 100% 17 / 17 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 27 / 27 SCAR 11.0
CC
3
Cov
100%
Check
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« blib/lib/Salvation/TC/Type/Number/Float.pm ↑ Summary blib/lib/Salvation/TC/Type/ScalarRef.pm »
1 package Salvation::TC::Type::Number::Integer;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use base 'Salvation::TC::Type::Number';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶use Salvation::TC::Exception::WrongType ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 my $re = qr/^[-+]?\d+$/;
11  
12 sub Check {
13  
14 51 ▶ my ( $class, $value ) = @_;
Subroutine Check: called CC=3 SCAR=11.0
Pod documented
15  
16 51 ▶ defined( $value ) || Salvation::TC::Exception::WrongType -> throw( 'type' => 'Integer', 'value' => 'UNDEFINED' );
Branch: 1 branch
BranchTrueFalseTotal
defined $value or "Salvation::TC::Exception::WrongType"->throw("type", "Integer", "value", "UNDEFINED") 2 49 51
17 49 ▶ ( $value =~ $re ) || Salvation::TC::Exception::WrongType -> throw( 'type' => 'Number::Integer', 'value' => $value );
Branch: 1 branch
BranchTrueFalseTotal
$value =~ /$re/ or "Salvation::TC::Exception::WrongType"->throw("type", "Number::Integer", "value", $value) 15 34 49
18 }
19  
20 4 1;
21 __END__
« blib/lib/Salvation/TC/Type/Number/Float.pm ↑ Summary blib/lib/Salvation/TC/Type/ScalarRef.pm »