This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
blead doesn't include cpan/perlfaq/inc/perlfaq.tt
[perl5.git] / cpan / Test-Simple / lib / Test / Stream / Event / Child.pm
CommitLineData
518760d9
CG
1package Test::Stream::Event::Child;
2use strict;
3use warnings;
4
5use Test::Stream::Carp qw/confess/;
6use Test::Stream::Event(
7 accessors => [qw/action name no_note/],
8);
9
10sub init {
11 confess "did not get an action" unless $_[0]->[ACTION];
12 confess "action must be either 'push' or 'pop', not '$_[0]->[ACTION]'"
13 unless $_[0]->[ACTION] =~ m/^(push|pop)$/;
14
15 $_[0]->[NAME] ||= "";
16}
17
181;
19
20__END__
21
22=head1 NAME
23
24Test::Stream::Event::Child - Child event type
25
26=head1 DESCRIPTION
27
28B<YOU PROBABLY DO NOT WANT TO USE THIS YOURSELF>
29
30Child events are used under the hood to start and stop subtests.
31L<Test::Stream::Event::Subtest> events are generated by child events.
32
33=head1 SYNOPSYS
34
35 use Test::Stream::Context qw/context/;
36 use Test::Stream::Event::Bail;
37
38 my $ctx = context();
39 $ctx->child( 'push', $NAME );
40
41 ... # Generate events
42
43 # Generates a subtest event
44 $ctx->child( 'pop', $NAME );
45
46=encoding utf8
47
48=head1 SOURCE
49
50The source code repository for Test::More can be found at
51F<http://github.com/Test-More/test-more/>.
52
53=head1 MAINTAINER
54
55=over 4
56
57=item Chad Granum E<lt>exodist@cpan.orgE<gt>
58
59=back
60
61=head1 AUTHORS
62
63The following people have all contributed to the Test-More dist (sorted using
64VIM's sort function).
65
66=over 4
67
68=item Chad Granum E<lt>exodist@cpan.orgE<gt>
69
70=item Fergal Daly E<lt>fergal@esatclear.ie>E<gt>
71
72=item Mark Fowler E<lt>mark@twoshortplanks.comE<gt>
73
74=item Michael G Schwern E<lt>schwern@pobox.comE<gt>
75
76=item 唐鳳
77
78=back
79
80=head1 COPYRIGHT
81
82There has been a lot of code migration between modules,
83here are all the original copyrights together:
84
85=over 4
86
87=item Test::Stream
88
89=item Test::Stream::Tester
90
91Copyright 2014 Chad Granum E<lt>exodist7@gmail.comE<gt>.
92
93This program is free software; you can redistribute it and/or
94modify it under the same terms as Perl itself.
95
96See F<http://www.perl.com/perl/misc/Artistic.html>
97
98=item Test::Simple
99
100=item Test::More
101
102=item Test::Builder
103
104Originally authored by Michael G Schwern E<lt>schwern@pobox.comE<gt> with much
105inspiration from Joshua Pritikin's Test module and lots of help from Barrie
106Slaymaker, Tony Bowden, blackstar.co.uk, chromatic, Fergal Daly and the perl-qa
107gang.
108
109Idea by Tony Bowden and Paul Johnson, code by Michael G Schwern
110E<lt>schwern@pobox.comE<gt>, wardrobe by Calvin Klein.
111
112Copyright 2001-2008 by Michael G Schwern E<lt>schwern@pobox.comE<gt>.
113
114This program is free software; you can redistribute it and/or
115modify it under the same terms as Perl itself.
116
117See F<http://www.perl.com/perl/misc/Artistic.html>
118
119=item Test::use::ok
120
121To the extent possible under law, 唐鳳 has waived all copyright and related
122or neighboring rights to L<Test-use-ok>.
123
124This work is published from Taiwan.
125
126L<http://creativecommons.org/publicdomain/zero/1.0>
127
128=item Test::Tester
129
130This module is copyright 2005 Fergal Daly <fergal@esatclear.ie>, some parts
131are based on other people's work.
132
133Under the same license as Perl itself
134
135See http://www.perl.com/perl/misc/Artistic.html
136
137=item Test::Builder::Tester
138
139Copyright Mark Fowler E<lt>mark@twoshortplanks.comE<gt> 2002, 2004.
140
141This program is free software; you can redistribute it
142and/or modify it under the same terms as Perl itself.
143
144=back