Tester/Abort.pm

filter: Statementstmt 100% 27 / 27 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 1 totaltotal 91.3% 42 / 46 CC 4 SCAR 5.2
CC
4
Cov
94%
__ANON__
3.0
as_test_abort_events
2.0
BEGIN
1.0
CRAP 1.7
« Tester/Response/Sentence/Set.pm ↑ Summary Tester/Response/Sentence.pm »
1 2 ▶use v5.20.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package JMAP::Tester::Abort 0.113;
3  
4 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 extends 'Throwable::Error';
6  
7 2 ▶use experimental 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 ▶use Sub::Exporter -setup => {
Subroutine BEGIN: called CC=1 SCAR=0.0
12 exports => {
13 5 ▶ abort => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
14 5 my $pkg = shift;
15 8 ▶ return sub (@args) { die $pkg->new(@args) }
Subroutine __ANON__: called CC=1 SCAR=0.0
16 5 }
17 }
18 2 };
19  
20 42 ▶around BUILDARGS => sub ($orig, $self, @args) {
Subroutine __ANON__: called CC=3 SCAR=11.1
21 42 ▶ return { message => $args[0] } if @args == 1 && ! ref $args[0];
Branch: 1 branch
BranchTrueFalseTotal
if @args == 1 and not ref $args[0] 10 32 42
Condition66%2/3
@args == 1 and not ref $args[0]
!ll&&!rl&&r
03210
MC/DC50%1/2
@args == 1 and not ref $args[0]
@args == 1 not ref $args[0]
Truth table66%2/3
A and not(B)
A= @args == 1B= not ref $args[0]
ABresult
0X0
100
111
22 32 return $self->$orig(@args);
23 2 };
24  
25 2 has message => (
26 is => 'ro',
27 required => 1,
28 );
29  
30 2 has diagnostics => (
31 is => 'ro',
32 );
33  
34 2 ▶sub as_test_abort_events ($self) {
Subroutine as_test_abort_events: called CC=2 SCAR=7.1
Pod undocumented
35 return [
36 [ Ok => (pass => 0, name => $self->message) ],
37 ($self->diagnostics
38 2 ▶ ? (map {; [ Diag => (message => $_) ] } @{ $self->diagnostics })
Branch: 1 branch
BranchTrueFalseTotal
$self->diagnostics ? : 2 0 2
39 : ()),
40 ];
41 }
42  
43 2 1;
44  
45 __END__
« Tester/Response/Sentence/Set.pm ↑ Summary Tester/Response/Sentence.pm »