This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
674527637c4d197c2d79b8d5846b78bfd1f60c92
[perl5.git] / cpan / Test-Simple / lib / Test2 / Event / Diag.pm
1 package Test2::Event::Diag;
2 use strict;
3 use warnings;
4
5 our $VERSION = '1.302071';
6
7
8 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
9 use Test2::Util::HashBase qw/message/;
10
11 sub init {
12     $_[0]->{+MESSAGE} = 'undef' unless defined $_[0]->{+MESSAGE};
13 }
14
15 sub summary { $_[0]->{+MESSAGE} }
16
17 sub diagnostics { 1 }
18
19 1;
20
21 __END__
22
23 =pod
24
25 =encoding UTF-8
26
27 =head1 NAME
28
29 Test2::Event::Diag - Diag event type
30
31 =head1 DESCRIPTION
32
33 Diagnostics messages, typically rendered to STDERR.
34
35 =head1 SYNOPSIS
36
37     use Test2::API qw/context/;
38     use Test2::Event::Diag;
39
40     my $ctx = context();
41     my $event = $ctx->diag($message);
42
43 =head1 ACCESSORS
44
45 =over 4
46
47 =item $diag->message
48
49 The message for the diag.
50
51 =back
52
53 =head1 SOURCE
54
55 The source code repository for Test2 can be found at
56 F<http://github.com/Test-More/test-more/>.
57
58 =head1 MAINTAINERS
59
60 =over 4
61
62 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
63
64 =back
65
66 =head1 AUTHORS
67
68 =over 4
69
70 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
71
72 =back
73
74 =head1 COPYRIGHT
75
76 Copyright 2016 Chad Granum E<lt>exodist@cpan.orgE<gt>.
77
78 This program is free software; you can redistribute it and/or
79 modify it under the same terms as Perl itself.
80
81 See F<http://dev.perl.org/licenses/>
82
83 =cut