blib/lib/Test2/Tools/Event.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 2 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 87.8% 29 / 33 CC 3 SCAR 6.4
CC
3
Cov
92%
gen_event
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« blib/lib/Test2/Tools/Exports.pm ↑ Summary blib/lib/Test2/EventFacet/Parent.pm »
1 package Test2::Tools::Event;
2 162 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 162 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 162 our $VERSION = '1.302226';
6  
7 162 ▶use Test2::Util qw/pkg_to_file/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 162 our @EXPORT = qw/gen_event/;
10 162 ▶use base 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 ▶sub gen_event {
Subroutine gen_event: called CC=3 SCAR=11.2
Pod documented
13 2 my ($type, %fields) = @_;
14  
15 2 ▶ $type = "Test2::Event::$type" unless $type =~ s/^\+//;
Branch: 1 branch
BranchTrueFalseTotal
unless $type =~ s/^\+// 1 1 2
16  
17 2 require(pkg_to_file($type));
18  
19 2 ▶ $fields{trace} ||= Test2::Util::Trace->new(frame => [caller(0)]);
Condition33%1/3
$fields{"trace"} ||= "Test2::Util::Trace"->new("frame", [caller 0])
l!l&&r!l&&!r
020
MC/DC0%0/2
$fields{"trace"} ||= "Test2::Util::Trace"->new("frame", [caller 0])
$fields{"trace"} "Test2::Util::Trace"->new("frame", [caller 0])
Truth table33%1/3
A ||= B
A= $fields{"trace"}B= "Test2::Util::Trace"->new("frame", [caller 0])
ABresult
1X1
011
000
20  
21 2 return $type->new(%fields);
22 }
23  
24 162 1;
25  
26 __END__
« blib/lib/Test2/Tools/Exports.pm ↑ Summary blib/lib/Test2/EventFacet/Parent.pm »