Perlito5X/Test2/Event.pm untested

filter: Statementstmt 0.0% 0 / 43 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 18 Podpod 0.0% 0 / 11 totaltotal 0.0% 0 / 79 CC 3 SCAR 12.5
CC
3
Cov
0%
from_json
12.0
causes_fail
2.0
increments_count
2.0
CRAP 3.5
1 package Test2::Event;
2 use strict;
3 use warnings;
4  
5 our $VERSION = '1.302073';
6  
7 use Test2::Util::HashBase qw/trace nested in_subtest subtest_id/;
8 use Test2::Util::ExternalMeta qw/meta get_meta set_meta delete_meta/;
9 use Test2::Util qw(pkg_to_file);
10 use Test2::Util::Trace;
11  
12 sub causes_fail { 0 }
13 sub increments_count { 0 }
14 sub diagnostics { 0 }
15 sub no_display { 0 }
16  
17 sub callback { }
18  
19 sub terminate { () }
20 sub global { () }
21 sub sets_plan { () }
22  
23 sub summary { ref($_[0]) }
24  
25 sub from_json {
26 my $class = shift;
27 my %p = @_;
28  
29 my $event_pkg = delete $p{__PACKAGE__};
30 require(pkg_to_file($event_pkg));
31  
32 if (exists $p{trace}) {
33 $p{trace} = Test2::Util::Trace->from_json(%{$p{trace}});
34 }
35  
36 if (exists $p{subevents}) {
37 my @subevents;
38 for my $subevent (@{delete $p{subevents} || []}) {
39 push @subevents, Test2::Event->from_json(%$subevent);
40 }
41 $p{subevents} = \@subevents;
42 }
43  
44 return $event_pkg->new(%p);
45 }
46  
47 sub TO_JSON {
48 my $self = shift;
49 return {%$self, __PACKAGE__ => ref $self};
50 }
51  
52 1;
53  
54 __END__