blib/lib/Salvation/TC/Type/SessionId.pm

filter: Statementstmt 87.5% 14 / 16 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 65.5% 19 / 29 SCAR 12.0
CC
3
Cov
67%
Check
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.3
« blib/lib/Salvation/TC/Meta/Type/Parameterized/HashRef.pm ↑ Summary blib/lib/Salvation/TC/Type/Text/English.pm »
1 package Salvation::TC::Type::SessionId;
2  
3 # $Id: SessionId.pm 6868 2014-06-03 10:59:59Z trojn $
4  
5 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶use base 'Salvation::TC::Type';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 ▶use Salvation::TC::Exception::WrongType ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 4 my $re = qr/^[A-Za-z0-9]{32}$/;
13  
14 sub Check {
15  
16 0 ▶ my ( $class, $session_id ) = @_;
Subroutine Check: not called CC=3 SCAR=24.8
Pod documented
17  
18 0 ▶ ( defined( $session_id ) && $session_id =~ $re ) ||
Branch: 1 branch
BranchTrueFalseTotal
defined $session_id and $session_id =~ /$re/ or "Salvation::TC::Exception::WrongType"->throw("type", "SessionId", "value", $session_id, "-text", "Wrong type for \"session_id\".") 0 0 0
Condition0%0/3
defined $session_id and $session_id =~ /$re/
!ll&&!rl&&r
000
MC/DC0%0/2
defined $session_id and $session_id =~ /$re/
defined $session_id $session_id =~ /$re/
Truth table0%0/3
A and B
A= defined $session_idB= $session_id =~ /$re/
ABresult
0X0
100
111
19 Salvation::TC::Exception::WrongType -> throw( 'type' => 'SessionId', 'value' => $session_id, '-text' => 'Wrong type for "session_id".' );
20 }
21  
22 4 1;
23 __END__
« blib/lib/Salvation/TC/Meta/Type/Parameterized/HashRef.pm ↑ Summary blib/lib/Salvation/TC/Type/Text/English.pm »