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

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