| 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
| |||||||||||
| 17 | 49 | ▶ | ( $value =~ $re ) || Salvation::TC::Exception::WrongType -> throw( 'type' => 'Number::Integer', 'value' => $value ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 4 | 1; | |||||||||
| 21 | __END__ | ||||||||||