line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Event::Pass; |
2
|
246
|
|
|
246
|
|
1950
|
use strict; |
|
246
|
|
|
|
|
614
|
|
|
246
|
|
|
|
|
7563
|
|
3
|
246
|
|
|
246
|
|
1314
|
use warnings; |
|
246
|
|
|
|
|
512
|
|
|
246
|
|
|
|
|
10327
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.302181'; |
6
|
|
|
|
|
|
|
|
7
|
246
|
|
|
246
|
|
1516
|
use Test2::EventFacet::Info; |
|
246
|
|
|
|
|
632
|
|
|
246
|
|
|
|
|
16758
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN { |
10
|
246
|
|
|
246
|
|
1851
|
require Test2::Event; |
11
|
246
|
|
|
|
|
4314
|
our @ISA = qw(Test2::Event); |
12
|
246
|
|
|
|
|
8536
|
*META_KEY = \&Test2::Util::ExternalMeta::META_KEY; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
246
|
|
|
246
|
|
1724
|
use Test2::Util::HashBase qw{ -name -info }; |
|
246
|
|
|
|
|
629
|
|
|
246
|
|
|
|
|
1821
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
############## |
18
|
|
|
|
|
|
|
# Old API |
19
|
1
|
|
|
1
|
1
|
11
|
sub summary { "pass" } |
20
|
1
|
|
|
1
|
1
|
4
|
sub increments_count { 1 } |
21
|
2
|
|
|
2
|
1
|
23
|
sub causes_fail { 0 } |
22
|
1
|
|
|
1
|
1
|
4
|
sub diagnostics { 0 } |
23
|
1
|
|
|
1
|
1
|
5
|
sub no_display { 0 } |
24
|
1
|
|
|
1
|
1
|
3
|
sub subtest_id { undef } |
25
|
1
|
|
|
1
|
1
|
4
|
sub terminate { () } |
26
|
590
|
|
|
590
|
1
|
1415
|
sub global { () } |
27
|
1
|
|
|
1
|
1
|
5
|
sub sets_plan { () } |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
############## |
30
|
|
|
|
|
|
|
# New API |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub add_info { |
33
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
3
|
for my $in (@_) { |
36
|
1
|
50
|
|
|
|
6
|
$in = {%$in} if ref($in) ne 'ARRAY'; |
37
|
1
|
|
|
|
|
8
|
$in = Test2::EventFacet::Info->new($in); |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
2
|
push @{$self->{+INFO}} => $in; |
|
1
|
|
|
|
|
4
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub facet_data { |
44
|
1594
|
|
|
1594
|
1
|
2297
|
my $self = shift; |
45
|
|
|
|
|
|
|
|
46
|
1594
|
|
|
|
|
3442
|
my $out = $self->common_facet_data; |
47
|
|
|
|
|
|
|
|
48
|
1594
|
|
|
|
|
2848
|
$out->{about}->{details} = 'pass'; |
49
|
|
|
|
|
|
|
|
50
|
1594
|
|
|
|
|
4134
|
$out->{assert} = {pass => 1, details => $self->{+NAME}}; |
51
|
|
|
|
|
|
|
|
52
|
1594
|
100
|
|
|
|
3172
|
$out->{info} = [map {{ %{$_} }} @{$self->{+INFO}}] if $self->{+INFO}; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
3
|
|
53
|
|
|
|
|
|
|
|
54
|
1594
|
|
|
|
|
3806
|
return $out; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=pod |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=encoding UTF-8 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 NAME |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Test2::Event::Pass - Event for a simple passing assertion |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 DESCRIPTION |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This is an optimal representation of a passing assertion. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SYNOPSIS |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
use Test2::API qw/context/; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub pass { |
78
|
|
|
|
|
|
|
my ($name) = @_; |
79
|
|
|
|
|
|
|
my $ctx = context(); |
80
|
|
|
|
|
|
|
$ctx->pass($name); |
81
|
|
|
|
|
|
|
$ctx->release; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 SOURCE |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
The source code repository for Test2 can be found at |
87
|
|
|
|
|
|
|
F<http://github.com/Test-More/test-more/>. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 MAINTAINERS |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=over 4 |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=item Chad Granum E<lt>exodist@cpan.orgE<gt> |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=back |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 AUTHORS |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=over 4 |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item Chad Granum E<lt>exodist@cpan.orgE<gt> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=back |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 COPYRIGHT |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Copyright 2020 Chad Granum E<lt>exodist@cpan.orgE<gt>. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
110
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
See F<http://dev.perl.org/licenses/> |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=cut |