line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Event::V2; |
2
|
246
|
|
|
246
|
|
1826
|
use strict; |
|
246
|
|
|
|
|
565
|
|
|
246
|
|
|
|
|
7465
|
|
3
|
246
|
|
|
246
|
|
1303
|
use warnings; |
|
246
|
|
|
|
|
580
|
|
|
246
|
|
|
|
|
10494
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.302180'; |
6
|
|
|
|
|
|
|
|
7
|
246
|
|
|
246
|
|
1446
|
use Scalar::Util qw/reftype/; |
|
246
|
|
|
|
|
615
|
|
|
246
|
|
|
|
|
12469
|
|
8
|
246
|
|
|
246
|
|
1631
|
use Carp qw/croak/; |
|
246
|
|
|
|
|
615
|
|
|
246
|
|
|
|
|
15336
|
|
9
|
|
|
|
|
|
|
|
10
|
246
|
|
|
246
|
|
1863
|
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } |
|
246
|
|
|
|
|
14033
|
|
11
|
|
|
|
|
|
|
|
12
|
246
|
|
|
|
|
21710
|
use Test2::Util::Facets2Legacy qw{ |
13
|
|
|
|
|
|
|
causes_fail diagnostics global increments_count no_display sets_plan |
14
|
|
|
|
|
|
|
subtest_id summary terminate |
15
|
246
|
|
|
246
|
|
108079
|
}; |
|
246
|
|
|
|
|
867
|
|
16
|
|
|
|
|
|
|
|
17
|
246
|
|
|
246
|
|
1816
|
use Test2::Util::HashBase qw/-about/; |
|
246
|
|
|
|
|
553
|
|
|
246
|
|
|
|
|
1647
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub non_facet_keys { |
20
|
|
|
|
|
|
|
return ( |
21
|
246
|
|
|
246
|
0
|
1398
|
+UUID, |
22
|
|
|
|
|
|
|
Test2::Util::ExternalMeta::META_KEY(), |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub init { |
27
|
227
|
|
|
227
|
0
|
632
|
my $self = shift; |
28
|
|
|
|
|
|
|
|
29
|
227
|
|
|
|
|
545
|
my $uuid; |
30
|
227
|
100
|
66
|
|
|
2987
|
if ($uuid = $self->{+UUID}) { |
|
|
100
|
|
|
|
|
|
31
|
|
|
|
|
|
|
croak "uuid '$uuid' passed to constructor, but uuid '$self->{+ABOUT}->{uuid}' is already set in the 'about' facet" |
32
|
4
|
100
|
100
|
|
|
249
|
if $self->{+ABOUT}->{uuid} && $self->{+ABOUT}->{uuid} ne $uuid; |
33
|
|
|
|
|
|
|
|
34
|
3
|
|
|
|
|
7
|
$self->{+ABOUT}->{uuid} = $uuid; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
elsif ($self->{+ABOUT} && $self->{+ABOUT}->{uuid}) { |
37
|
1
|
|
|
|
|
2
|
$uuid = $self->{+ABOUT}->{uuid}; |
38
|
1
|
|
|
|
|
8
|
$self->SUPER::set_uuid($uuid); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# Clone the trace, make sure it is blessed |
42
|
226
|
100
|
|
|
|
1250
|
if (my $trace = $self->{+TRACE}) { |
43
|
220
|
|
|
|
|
2197
|
$self->{+TRACE} = Test2::EventFacet::Trace->new(%$trace); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub set_uuid { |
48
|
2
|
|
|
2
|
1
|
13
|
my $self = shift; |
49
|
2
|
|
|
|
|
7
|
my ($uuid) = @_; |
50
|
2
|
|
|
|
|
6
|
$self->{+ABOUT}->{uuid} = $uuid; |
51
|
2
|
|
|
|
|
13
|
$self->SUPER::set_uuid($uuid); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub facet_data { |
55
|
245
|
|
|
245
|
1
|
1088
|
my $self = shift; |
56
|
245
|
|
|
|
|
773
|
my $f = { %{$self} }; |
|
245
|
|
|
|
|
1296
|
|
57
|
|
|
|
|
|
|
|
58
|
245
|
|
|
|
|
1247
|
delete $f->{$_} for $self->non_facet_keys; |
59
|
|
|
|
|
|
|
|
60
|
245
|
|
|
|
|
904
|
my %out; |
61
|
245
|
|
|
|
|
1415
|
for my $k (keys %$f) { |
62
|
969
|
100
|
|
|
|
3177
|
next if substr($k, 0, 1) eq '_'; |
63
|
|
|
|
|
|
|
|
64
|
737
|
50
|
|
|
|
2182
|
my $data = $f->{$k} or next; # Key is there, but no facet |
65
|
737
|
|
50
|
|
|
3118
|
my $is_list = 'ARRAY' eq (reftype($data) || ''); |
66
|
737
|
100
|
|
|
|
3779
|
$out{$k} = $is_list ? [ map { {%{$_}} } @$data ] : {%$data}; |
|
282
|
|
|
|
|
982
|
|
|
282
|
|
|
|
|
2698
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
245
|
100
|
|
|
|
2147
|
if (my $meta = $self->meta_facet_data) { |
70
|
1
|
50
|
|
|
|
5
|
$out{meta} = {%$meta, %{$out{meta} || {}}}; |
|
1
|
|
|
|
|
8
|
|
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
245
|
|
|
|
|
1602
|
return \%out; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |