| 1 | package Perinci::Result::Util; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use 5.010001; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | require Exporter; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | our @ISA = qw(Exporter); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 2 | our @EXPORT_OK = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | is_env_res | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 2 | our $VERSION = '0.03'; # VERSION | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 2 | our $DATE = '2015-09-03'; # DATE | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 18 | ▶ | sub is_env_res { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_env_res: called CC=12 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 18 | my $res = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 18 | ▶ | return 0 unless ref($res) eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 16 | ▶ | return 0 unless @$res <= 4; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | # check status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 15 | ▶ | return 0 unless defined($res->[0]) && $res->[0] =~ /\A[0-9]{1,3}\z/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
defined $res->[0] and $res->[0] =~ /\A[0-9]{1,3}\z/ and $res->[0] >= 100 and $res->[0] < 599
defined $res->[0] and $res->[0] =~ /\A[0-9]{1,3}\z/ and $res->[0] >= 100
defined $res->[0] and $res->[0] =~ /\A[0-9]{1,3}\z/
MC/DC100%4/4
defined $res->[0] and $res->[0] =~ /\A[0-9]{1,3}\z/ and $res->[0] >= 100 and $res->[0] < 599
defined $res->[0]
$res->[0] =~ /\A[0-9]{1,3}\z/
$res->[0] >= 100
$res->[0] < 599
Truth table100%5/5
A and B and C and D
A= defined $res->[0]B= $res->[0] =~ /\A[0-9]{1,3}\z/C= $res->[0] >= 100D= $res->[0] < 599
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | && $res->[0] >= 100 && $res->[0] < 599; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | # check message | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 8 | ▶ | return 0 unless !ref($res->[1]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 7 | ▶ | if (defined $res->[1]) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 6 | ▶ | return 0 unless $res->[1] =~ /[A-Za-z]/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | # check result metadata | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 6 | ▶ | return 0 if defined($res->[3]) && ref($res->[3]) ne 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $res->[3] and ref $res->[3] ne "HASH"
MC/DC100%2/2
defined $res->[3] and ref $res->[3] ne "HASH"
defined $res->[3]
ref $res->[3] ne "HASH"
Truth table100%3/3
A and B
A= defined $res->[3]B= ref $res->[3] ne "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | # ABSTRACT: Utilities related to enveloped result | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||