blib/lib/Test2/Event.pm

filter: Statementstmt 94.6% 193 / 204 Branchbran 82.0% 87 / 106 Conditioncond 81.2% 39 / 48 MC/DCmcdc 57.1% 16 / 28 Subroutinesub 95.1% 39 / 41 Podpod 86.9% 20 / 23 totaltotal 87.5% 394 / 450 CC 76 SCAR 22.5
CC
76
Cov
89%
facet_data
21.0
validate_facet_data
17.1
in_subtest
9.4
CRAP 9.5
« blib/lib/Test2/API/InterceptResult/Event.pm ↑ Summary blib/lib/Test2/Compare/Array.pm »
1 package Test2::Event;
2 455 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 455 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 455 our $VERSION = '1.302226';
6  
7 455 ▶use Scalar::Util qw/blessed reftype/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 455 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 455 ▶use Test2::Util::HashBase qw/trace -amnesty uuid -_eid -hubs/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 455 ▶use Test2::Util::ExternalMeta qw/meta get_meta set_meta delete_meta/;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 455 ▶use Test2::Util qw/pkg_to_file gen_uid/;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 455 ▶use Test2::EventFacet::About();
Subroutine BEGIN: called CC=1 SCAR=0.0
15 455 ▶use Test2::EventFacet::Amnesty();
Subroutine BEGIN: called CC=1 SCAR=0.0
16 455 ▶use Test2::EventFacet::Assert();
Subroutine BEGIN: called CC=1 SCAR=0.0
17 455 ▶use Test2::EventFacet::Control();
Subroutine BEGIN: called CC=1 SCAR=0.0
18 455 ▶use Test2::EventFacet::Error();
Subroutine BEGIN: called CC=1 SCAR=0.0
19 455 ▶use Test2::EventFacet::Info();
Subroutine BEGIN: called CC=1 SCAR=0.0
20 455 ▶use Test2::EventFacet::Meta();
Subroutine BEGIN: called CC=1 SCAR=0.0
21 455 ▶use Test2::EventFacet::Parent();
Subroutine BEGIN: called CC=1 SCAR=0.0
22 455 ▶use Test2::EventFacet::Plan();
Subroutine BEGIN: called CC=1 SCAR=0.0
23 455 ▶use Test2::EventFacet::Trace();
Subroutine BEGIN: called CC=1 SCAR=0.0
24 455 ▶use Test2::EventFacet::Hub();
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 # Legacy tools will expect this to be loaded now
27 455 require Test2::Util::Trace;
28  
29 455 my %LOADED_FACETS = (
30 'about' => 'Test2::EventFacet::About',
31 'amnesty' => 'Test2::EventFacet::Amnesty',
32 'assert' => 'Test2::EventFacet::Assert',
33 'control' => 'Test2::EventFacet::Control',
34 'errors' => 'Test2::EventFacet::Error',
35 'info' => 'Test2::EventFacet::Info',
36 'meta' => 'Test2::EventFacet::Meta',
37 'parent' => 'Test2::EventFacet::Parent',
38 'plan' => 'Test2::EventFacet::Plan',
39 'trace' => 'Test2::EventFacet::Trace',
40 'hubs' => 'Test2::EventFacet::Hub',
41 );
42  
43 0 ▶sub FACET_TYPES { sort values %LOADED_FACETS }
Subroutine FACET_TYPES: not called CC=1 SCAR=6.9
Pod documented
44  
45 242 ▶sub load_facet {
Subroutine load_facet: called CC=6 SCAR=19.5
Pod documented
46 242 my $class = shift;
47 242 my ($facet) = @_;
48  
49 242 ▶ return $LOADED_FACETS{$facet} if exists $LOADED_FACETS{$facet};
Branch: 1 branch
BranchTrueFalseTotal
if exists $LOADED_FACETS{$facet} 236 6 242
50  
51 6 my @check = ($facet);
52 6 ▶ if ('s' eq substr($facet, -1, 1)) {
Branch: 1 branch
BranchTrueFalseTotal
if ('s' eq substr($facet, -1, 1)) { } 0 6 6
53 0 push @check => substr($facet, 0, -1);
54 }
55 else {
56 6 push @check => $facet . 's';
57 }
58  
59 6 my $found;
60 6 for my $check (@check) {
61 12 my $mod = "Test2::EventFacet::" . ucfirst($facet);
62 12 my $file = pkg_to_file($mod);
63 0 ▶ next unless eval { require $file; 1 };
Branch: 1 branch
BranchTrueFalseTotal
unless eval { do { require $file; 1 } } 12 0 12
64 0 $found = $mod;
65 0 last;
66 }
67  
68 6 ▶ return undef unless $found;
Branch: 1 branch
BranchTrueFalseTotal
unless $found 6 0 6
69 0 $LOADED_FACETS{$facet} = $found;
70 }
71  
72 1359 ▶sub causes_fail { 0 }
Subroutine causes_fail: called CC=1 SCAR=0.0
Pod documented
73 1360 ▶sub increments_count { 0 }
Subroutine increments_count: called CC=1 SCAR=0.0
Pod documented
74 1 ▶sub diagnostics { 0 }
Subroutine diagnostics: called CC=1 SCAR=0.0
Pod documented
75 13 ▶sub no_display { 0 }
Subroutine no_display: called CC=1 SCAR=0.0
Pod documented
76 1377 ▶sub subtest_id { undef }
Subroutine subtest_id: called CC=1 SCAR=0.0
Pod documented
77  
78 0 ▶sub callback { }
Subroutine callback: not called CC=1 SCAR=0.0
Pod documented
79  
80 3166 ▶sub terminate { () }
Subroutine terminate: called CC=1 SCAR=0.0
Pod documented
81 3381 ▶sub global { () }
Subroutine global: called CC=1 SCAR=0.0
Pod documented
82 1359 ▶sub sets_plan { () }
Subroutine sets_plan: called CC=1 SCAR=0.0
Pod documented
83  
84 1392 ▶sub summary { ref($_[0]) }
Subroutine summary: called CC=1 SCAR=0.0
Pod documented
85  
86 9 ▶sub related {
Subroutine related: called CC=9 SCAR=22.1
Pod documented
87 9 my $self = shift;
88 9 my ($event) = @_;
89  
90 9 ▶ my $tracea = $self->trace or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $tracea = $self->trace or return undef 8 1 9
91 8 ▶ my $traceb = $event->trace or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $traceb = $event->trace or return undef 8 0 8
92  
93 8 my $uuida = $tracea->uuid;
94 8 my $uuidb = $traceb->uuid;
95 8 ▶ if ($uuida && $uuidb) {
Branch: 1 branch
BranchTrueFalseTotal
if ($uuida and $uuidb) 2 6 8
Condition66%2/3
$uuida and $uuidb
!ll&&!rl&&r
602
MC/DC50%1/2
$uuida and $uuidb
$uuida $uuidb
Truth table66%2/3
A and B
A= $uuidaB= $uuidb
ABresult
0X0
100
111
96 2 ▶ return 1 if $uuida eq $uuidb;
Branch: 1 branch
BranchTrueFalseTotal
if $uuida eq $uuidb 1 1 2
97 1 return 0;
98 }
99  
100 6 ▶ my $siga = $tracea->signature or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $siga = $tracea->signature or return undef 4 2 6
101 4 ▶ my $sigb = $traceb->signature or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $sigb = $traceb->signature or return undef 4 0 4
102  
103 4 ▶ return 1 if $siga eq $sigb;
Branch: 1 branch
BranchTrueFalseTotal
if $siga eq $sigb 2 2 4
104 2 return 0;
105 }
106  
107 11563 ▶sub add_hub {
Subroutine add_hub: called CC=1 SCAR=0.0
Pod undocumented
108 11563 my $self = shift;
109 11563 unshift @{$self->{+HUBS}} => @_;
110 }
111  
112 320 ▶sub add_amnesty {
Subroutine add_amnesty: called CC=3 SCAR=11.0
Pod documented
113 320 my $self = shift;
114  
115 320 for my $am (@_) {
116 320 ▶ $am = {%$am} if ref($am) ne 'ARRAY';
Branch: 1 branch
BranchTrueFalseTotal
if ref $am ne "ARRAY" 320 0 320
117 320 $am = Test2::EventFacet::Amnesty->new($am);
118  
119 320 push @{$self->{+AMNESTY}} => $am;
120 }
121 }
122  
123 13874 ▶sub eid { $_[0]->{+_EID} ||= gen_uid() }
Subroutine eid: called CC=2 SCAR=7.2
Pod undocumented
Condition66%2/3
$_[0]{"_eid"} ||= &gen_uid()
l!l&&r!l&&!r
2272116020
MC/DC0%0/2
$_[0]{"_eid"} ||= &gen_uid()
$_[0]{"_eid"} &gen_uid()
Truth table66%2/3
A ||= B
A= $_[0]{"_eid"}B= &gen_uid()
ABresult
1X1
011
000
124  
125 23729 ▶sub common_facet_data {
Subroutine common_facet_data: called CC=8 SCAR=20.8
Pod documented
126 23729 my $self = shift;
127  
128 23729 my %out;
129  
130 23729 ▶ $out{about} = {package => ref($self) || undef};
Condition50%1/2
ref $self || undef
l!l
237290
MC/DC0%0/1
ref $self || undef
ref $self
Truth table50%1/2
A
A= ref $self
Aresult
11
00
131 23729 ▶ if (my $uuid = $self->uuid) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $uuid = $self->uuid) 73 23656 23729
132 73 $out{about}->{uuid} = $uuid;
133 }
134  
135 23729 ▶ $out{about}->{eid} = $self->{+_EID} || $self->eid;
Condition66%2/3
$self->{'_eid'} || $self->eid
l!l&&r!l&&!r
2144722820
MC/DC0%0/2
$self->{'_eid'} || $self->eid
$self->{'_eid'} $self->eid
Truth table66%2/3
A || B
A= $self->{'_eid'}B= $self->eid
ABresult
1X1
011
000
136  
137 23729 ▶ if (my $trace = $self->trace) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $trace = $self->trace) 23715 14 23729
138 23715 $out{trace} = { %$trace };
139 }
140  
141 23729 ▶ if (my $hubs = $self->hubs) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $hubs = $self->hubs) 21398 2331 23729
142 21398 $out{hubs} = $hubs;
143 }
144  
145 537 $out{amnesty} = [map {{ %{$_} }} @{$self->{+AMNESTY}}]
146 23729 ▶ if $self->{+AMNESTY};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"amnesty"} 382 23347 23729
147  
148 23729 ▶ if (my $meta = $self->meta_facet_data) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $meta = $self->meta_facet_data) 1014 22715 23729
149 1014 $out{meta} = $meta;
150 }
151  
152 23729 return \%out;
153 }
154  
155 24145 ▶sub meta_facet_data {
Subroutine meta_facet_data: called CC=2 SCAR=6.9
Pod undocumented
156 24145 my $self = shift;
157  
158 24145 my $key = Test2::Util::ExternalMeta::META_KEY();
159  
160 24145 ▶ my $hash = $self->{$key} or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $hash = $self->{$key} or return undef 1015 23130 24145
161 1015 return {%$hash};
162 }
163  
164 1378 ▶sub facet_data {
Subroutine facet_data: called CC=21 SCAR=30.5
Pod documented
165 1378 my $self = shift;
166  
167 1378 my $out = $self->common_facet_data;
168  
169 1378 ▶ $out->{about}->{details} = $self->summary || undef;
Condition50%1/2
$self->summary || undef
l!l
13780
MC/DC0%0/1
$self->summary || undef
$self->summary
Truth table50%1/2
A
A= $self->summary
Aresult
11
00
170 1378 ▶ $out->{about}->{no_display} = $self->no_display || undef;
Condition100%2/2
$self->no_display || undef
l!l
134731
MC/DC100%1/1
$self->no_display || undef
$self->no_display
Truth table100%2/2
A
A= $self->no_display
Aresult
11
00
171  
172 # Might be undef, we want to preserve that
173 1378 my $terminate = $self->terminate;
174 $out->{control} = {
175 1378 ▶ global => $self->global || 0,
Branch: 1 branch
BranchTrueFalseTotal
$self->can('callback') == \&Test2::Event::callback ? : 25 1353 1378
Condition100%2/2
$self->global || 0
l!l
71371
MC/DC100%1/1
$self->global || 0
$self->global
Truth table100%2/2
A
A= $self->global
Aresult
11
00
176 terminate => $terminate,
177 has_callback => $self->can('callback') == \&callback ? 0 : 1,
178 };
179  
180 $out->{assert} = {
181 1378 ▶ no_debug => 1, # Legacy behavior
Branch: 2 branches
BranchTrueFalseTotal
if $self->increments_count 11 1367 1378
$self->causes_fail ? : 3 8 11
182 pass => $self->causes_fail ? 0 : 1,
183 details => $self->summary,
184 } if $self->increments_count;
185  
186 1378 ▶ $out->{parent} = {hid => $self->subtest_id} if $self->subtest_id;
Branch: 1 branch
BranchTrueFalseTotal
if $self->subtest_id 1 1377 1378
187  
188 1378 ▶ if (my @plan = $self->sets_plan) {
Branch: 1 branch
BranchTrueFalseTotal
if (my(@plan) = $self->sets_plan) 4 1374 1378
189 4 $out->{plan} = {};
190  
191 4 ▶ $out->{plan}->{count} = $plan[0] if defined $plan[0];
Branch: 1 branch
BranchTrueFalseTotal
if defined $plan[0] 4 0 4
192 4 ▶ $out->{plan}->{details} = $plan[2] if defined $plan[2];
Branch: 1 branch
BranchTrueFalseTotal
if defined $plan[2] 3 1 4
193  
194 4 ▶ if ($plan[1]) {
Branch: 1 branch
BranchTrueFalseTotal
if ($plan[1]) 3 1 4
195 3 ▶ $out->{plan}->{skip} = 1 if $plan[1] eq 'SKIP';
Branch: 1 branch
BranchTrueFalseTotal
if $plan[1] eq "SKIP" 1 2 3
196 3 ▶ $out->{plan}->{none} = 1 if $plan[1] eq 'NO PLAN';
Branch: 1 branch
BranchTrueFalseTotal
if $plan[1] eq "NO PLAN" 2 1 3
197 }
198  
199 4 ▶ $out->{control}->{terminate} ||= 0 if $out->{plan}->{skip};
Branch: 1 branch
BranchTrueFalseTotal
if $out->{"plan"}{"skip"} 1 3 4
Condition50%1/2
$out->{"control"}{"terminate"} ||= 0
l!l
01
MC/DC0%0/1
$out->{"control"}{"terminate"} ||= 0
$out->{"control"}{"terminate"}
Truth table50%1/2
A
A= $out->{"control"}{"terminate"}
Aresult
11
00
200 }
201  
202 1378 ▶ if ($self->causes_fail && !$out->{assert}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->causes_fail and not $out->{"assert"}) 1 1376 1377
Condition100%3/3
$self->causes_fail and not $out->{"assert"}
!ll&&!rl&&r
137331
MC/DC100%2/2
$self->causes_fail and not $out->{"assert"}
$self->causes_fail not $out->{"assert"}
Truth table100%3/3
A and not(B)
A= $self->causes_failB= not $out->{"assert"}
ABresult
0X0
100
111
203 $out->{errors} = [
204 {
205 1 tag => 'FAIL',
206 fail => 1,
207 details => $self->summary,
208 }
209 ];
210 }
211  
212 1377 my %IGNORE = (trace => 1, about => 1, control => 1);
213 1377 my $do_info = !grep { !$IGNORE{$_} } keys %$out;
214  
215 1377 ▶ if ($do_info && !$self->no_display && $self->diagnostics) {
Branch: 1 branch
BranchTrueFalseTotal
if ($do_info and not $self->no_display and $self->diagnostics) 2 1375 1377
Condition100%6/6
$do_info and not $self->no_display and $self->diagnostics
!ll&&!rl&&r
137232
$do_info and not $self->no_display
!ll&&!rl&&r
1275975
MC/DC100%3/3
$do_info and not $self->no_display and $self->diagnostics
$do_info not $self->no_display $self->diagnostics
Truth table100%4/4
A and not(B) and C
A= $do_infoB= not $self->no_displayC= $self->diagnostics
ABCresult
0XX0
10X0
1100
1111
216 $out->{info} = [
217 {
218 2 tag => 'DIAG',
219 debug => 1,
220 details => $self->summary,
221 }
222 ];
223 }
224  
225 1377 return $out;
226 }
227  
228 23 ▶sub facets {
Subroutine facets: called CC=6 SCAR=18.2
Pod documented
229 23 my $self = shift;
230 23 my %out;
231  
232 23 my $data = $self->facet_data;
233 23 my @errors = $self->validate_facet_data($data);
234 23 ▶ die join "\n" => @errors if @errors;
Branch: 1 branch
BranchTrueFalseTotal
if @errors 0 23 23
235  
236 23 for my $facet (keys %$data) {
237 112 my $class = $self->load_facet($facet);
238 112 my $val = $data->{$facet};
239  
240 112 ▶ unless($class) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($class) 0 112 112
241 0 $out{$facet} = $val;
242 0 next;
243 }
244  
245 112 ▶ my $is_list = reftype($val) eq 'ARRAY' ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
builtin::reftype($val) eq 'ARRAY' ? : 34 78 112
246 112 ▶ if ($is_list) {
Branch: 1 branch
BranchTrueFalseTotal
if ($is_list) { } 34 78 112
247 34 $out{$facet} = [map { $class->new($_) } @$val];
248 }
249 else {
250 78 $out{$facet} = $class->new($val);
251 }
252 }
253  
254 23 return \%out;
255 }
256  
257 29 ▶sub validate_facet_data {
Subroutine validate_facet_data: called CC=17 SCAR=28.4
Pod documented
258 29 my $class_or_self = shift;
259 29 my ($f, %params);
260  
261 29 ▶ $f = shift if @_ && (reftype($_[0]) || '') eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
if @_ and (builtin::reftype($_[0]) || "") eq "HASH" 26 3 29
Condition100%5/5
@_ and (builtin::reftype($_[0]) || "") eq "HASH"
!ll&&!rl&&r
2126
builtin::reftype($_[0]) || ''
l!l
261
MC/DC100%2/2
@_ and (builtin::reftype($_[0]) || "") eq "HASH"
@_ builtin::reftype($_[0])
Truth table100%3/3
A and B
A= @_B= builtin::reftype($_[0])
ABresult
0X0
100
111
262 29 %params = @_;
263  
264 29 ▶ $f ||= $class_or_self->facet_data if blessed($class_or_self);
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($class_or_self) 26 3 29
Condition66%2/3
$f ||= $class_or_self->facet_data
l!l&&r!l&&!r
2330
MC/DC0%0/2
$f ||= $class_or_self->facet_data
$f $class_or_self->facet_data
Truth table66%2/3
A ||= B
A= $fB= $class_or_self->facet_data
ABresult
1X1
011
000
265 29 ▶ croak "No facet data" unless $f;
Branch: 1 branch
BranchTrueFalseTotal
unless $f 0 29 29
266  
267 29 my @errors;
268  
269 29 for my $k (sort keys %$f) {
270 130 my $fclass = $class_or_self->load_facet($k);
271  
272 push @errors => "Could not find a facet class for facet '$k'"
273 130 ▶ if $params{require_facet_class} && !$fclass;
Branch: 1 branch
BranchTrueFalseTotal
if $params{"require_facet_class"} and not $fclass 2 128 130
Condition100%3/3
$params{"require_facet_class"} and not $fclass
!ll&&!rl&&r
12442
MC/DC100%2/2
$params{"require_facet_class"} and not $fclass
$params{"require_facet_class"} not $fclass
Truth table100%3/3
A and not(B)
A= $params{"require_facet_class"}B= not $fclass
ABresult
0X0
100
111
274  
275 130 ▶ next unless $fclass;
Branch: 1 branch
BranchTrueFalseTotal
unless $fclass 6 124 130
276  
277 124 my $v = $f->{$k};
278 124 ▶ next unless defined($v); # undef is always fine
Branch: 1 branch
BranchTrueFalseTotal
unless defined $v 0 124 124
279  
280 124 my $is_list = $fclass->is_list();
281 124 ▶ my $got_list = reftype($v) eq 'ARRAY' ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
builtin::reftype($v) eq 'ARRAY' ? : 40 84 124
282  
283 124 ▶ push @errors => "Facet '$k' should be a list, but got a single item ($v)"
Branch: 1 branch
BranchTrueFalseTotal
if $is_list and not $got_list 4 120 124
Condition100%3/3
$is_list and not $got_list
!ll&&!rl&&r
84364
MC/DC100%2/2
$is_list and not $got_list
$is_list not $got_list
Truth table100%3/3
A and not(B)
A= $is_listB= not $got_list
ABresult
0X0
100
111
284 if $is_list && !$got_list;
285  
286 124 ▶ push @errors => "Facet '$k' should not be a list, but got a a list ($v)"
Branch: 1 branch
BranchTrueFalseTotal
if $got_list and not $is_list 4 120 124
Condition100%3/3
$got_list and not $is_list
!ll&&!rl&&r
84364
MC/DC100%2/2
$got_list and not $is_list
$got_list not $is_list
Truth table100%3/3
A and not(B)
A= $got_listB= not $is_list
ABresult
0X0
100
111
287 if $got_list && !$is_list;
288 }
289  
290 29 return @errors;
291 }
292  
293 2 ▶sub nested {
Subroutine nested: called CC=5 SCAR=18.1
Pod documented
294 2 my $self = shift;
295  
296 Carp::cluck("Use of Test2::Event->nested() is deprecated, use Test2::Event->trace->nested instead")
297 2 ▶ if $ENV{AUTHOR_TESTING};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"AUTHOR_TESTING"} 1 1 2
298  
299 2 ▶ if (my $hubs = $self->{+HUBS}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $hubs = $self->{"hubs"}) 0 2 2
300 0 ▶ return $hubs->[0]->{nested} if @$hubs;
Branch: 1 branch
BranchTrueFalseTotal
if @$hubs 0 0 0
301 }
302  
303 2 ▶ my $trace = $self->{+TRACE} or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $trace = $self->{"trace"} or return undef 2 0 2
304 2 return $trace->{nested};
305 }
306  
307 2 ▶sub in_subtest {
Subroutine in_subtest: called CC=7 SCAR=22.4
Pod documented
308 2 my $self = shift;
309  
310 Carp::cluck("Use of Test2::Event->in_subtest() is deprecated, use Test2::Event->trace->hid instead")
311 2 ▶ if $ENV{AUTHOR_TESTING};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"AUTHOR_TESTING"} 1 1 2
312  
313 2 my $hubs = $self->{+HUBS};
314 2 ▶ if ($hubs && @$hubs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($hubs and @$hubs) 0 2 2
Condition33%1/3
$hubs and @$hubs
!ll&&!rl&&r
200
MC/DC0%0/2
$hubs and @$hubs
$hubs @$hubs
Truth table33%1/3
A and B
A= $hubsB= @$hubs
ABresult
0X0
100
111
315 0 ▶ return undef unless $hubs->[0]->{nested};
Branch: 1 branch
BranchTrueFalseTotal
unless $hubs->[0]{"nested"} 0 0 0
316 return $hubs->[0]->{hid}
317 0 }
318  
319 2 ▶ my $trace = $self->{+TRACE} or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $trace = $self->{"trace"} or return undef 2 0 2
320 2 ▶ return undef unless $trace->{nested};
Branch: 1 branch
BranchTrueFalseTotal
unless $trace->{"nested"} 1 1 2
321 1 return $trace->{hid};
322 }
323  
324 455 1;
325  
326 __END__
« blib/lib/Test2/API/InterceptResult/Event.pm ↑ Summary blib/lib/Test2/Compare/Array.pm »