| 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
| |||||||||||||||||||||
| 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])
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])
| |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 2 | return $type->new(%fields); | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 162 | 1; | |||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | __END__ | ||||||||||||||||||||