line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Event::Encoding; |
2
|
1
|
|
|
1
|
|
534
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
30
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.302181'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use Carp qw/croak/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
90
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
7
|
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } |
|
1
|
|
|
|
|
47
|
|
10
|
1
|
|
|
1
|
|
6
|
use Test2::Util::HashBase qw/encoding/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub init { |
13
|
2
|
|
|
2
|
0
|
5
|
my $self = shift; |
14
|
2
|
100
|
|
|
|
214
|
defined $self->{+ENCODING} or croak "'encoding' is a required attribute"; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
1
|
11
|
sub summary { 'Encoding set to ' . $_[0]->{+ENCODING} } |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub facet_data { |
20
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
21
|
1
|
|
|
|
|
9
|
my $out = $self->common_facet_data; |
22
|
1
|
|
|
|
|
3
|
$out->{control}->{encoding} = $self->{+ENCODING}; |
23
|
1
|
|
|
|
|
3
|
$out->{about}->{details} = $self->summary; |
24
|
1
|
|
|
|
|
4
|
return $out; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=pod |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=encoding UTF-8 |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Test2::Event::Encoding - Set the encoding for the output stream |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 DESCRIPTION |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
The encoding event is generated when a test file wants to specify the encoding |
43
|
|
|
|
|
|
|
to be used when formatting its output. This event is intended to be produced |
44
|
|
|
|
|
|
|
by formatter classes and used for interpreting test names, message contents, |
45
|
|
|
|
|
|
|
etc. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 SYNOPSIS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
use Test2::API qw/context/; |
50
|
|
|
|
|
|
|
use Test2::Event::Encoding; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my $ctx = context(); |
53
|
|
|
|
|
|
|
my $event = $ctx->send_event('Encoding', encoding => 'UTF-8'); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 METHODS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Inherits from L<Test2::Event>. Also defines: |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=over 4 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item $encoding = $e->encoding |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
The encoding being specified. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=back |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 SOURCE |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
The source code repository for Test2 can be found at |
70
|
|
|
|
|
|
|
F<http://github.com/Test-More/test-more/>. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 MAINTAINERS |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=over 4 |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item Chad Granum E<lt>exodist@cpan.orgE<gt> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=back |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 AUTHORS |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=over 4 |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item Chad Granum E<lt>exodist@cpan.orgE<gt> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=back |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 COPYRIGHT |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Copyright 2020 Chad Granum E<lt>exodist@cpan.orgE<gt>. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
93
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
See F<http://dev.perl.org/licenses/> |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |