This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Test-Simple to alpha 073
[perl5.git] / cpan / Test-Simple / lib / ok.pm
1 package ok;
2 use strict;
3 use warnings;
4
5 use Test::Stream 1.301001 '-internal';
6 use Test::More 1.301001 ();
7 use Test::Stream::Carp qw/croak/;
8
9 our $VERSION = '1.301001_073';
10 $VERSION = eval $VERSION;    ## no critic (BuiltinFunctions::ProhibitStringyEval)
11
12 sub import {
13     shift;
14
15     if (@_) {
16         croak "'use ok' called with an empty argument, did you try to use a package name from an uninitialized variable?"
17             unless defined $_[0];
18
19         goto &Test::More::pass if $_[0] eq 'ok';
20         goto &Test::More::use_ok;
21     }
22 }
23
24 1;
25
26 __END__
27
28 =encoding utf8
29
30 =head1 NAME
31
32 ok - Alternative to Test::More::use_ok
33
34 =head1 SYNOPSIS
35
36     use ok 'Some::Module';
37
38 =head1 DESCRIPTION
39
40 With this module, simply change all C<use_ok> in test scripts to C<use ok>,
41 and they will be executed at C<BEGIN> time.
42
43 Please see L<Test::use::ok> for the full description.
44
45 =encoding utf8
46
47 =head1 SOURCE
48
49 The source code repository for Test::More can be found at
50 F<http://github.com/Test-More/test-more/>.
51
52 =head1 MAINTAINER
53
54 =over 4
55
56 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
57
58 =back
59
60 =head1 AUTHORS
61
62 The following people have all contributed to the Test-More dist (sorted using
63 VIM's sort function).
64
65 =over 4
66
67 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
68
69 =item Fergal Daly E<lt>fergal@esatclear.ie>E<gt>
70
71 =item Mark Fowler E<lt>mark@twoshortplanks.comE<gt>
72
73 =item Michael G Schwern E<lt>schwern@pobox.comE<gt>
74
75 =item 唐鳳
76
77 =back
78
79 =head1 COPYRIGHT
80
81 There has been a lot of code migration between modules,
82 here are all the original copyrights together:
83
84 =over 4
85
86 =item Test::Stream
87
88 =item Test::Stream::Tester
89
90 Copyright 2014 Chad Granum E<lt>exodist7@gmail.comE<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://www.perl.com/perl/misc/Artistic.html>
96
97 =item Test::Simple
98
99 =item Test::More
100
101 =item Test::Builder
102
103 Originally authored by Michael G Schwern E<lt>schwern@pobox.comE<gt> with much
104 inspiration from Joshua Pritikin's Test module and lots of help from Barrie
105 Slaymaker, Tony Bowden, blackstar.co.uk, chromatic, Fergal Daly and the perl-qa
106 gang.
107
108 Idea by Tony Bowden and Paul Johnson, code by Michael G Schwern
109 E<lt>schwern@pobox.comE<gt>, wardrobe by Calvin Klein.
110
111 Copyright 2001-2008 by Michael G Schwern E<lt>schwern@pobox.comE<gt>.
112
113 This program is free software; you can redistribute it and/or
114 modify it under the same terms as Perl itself.
115
116 See F<http://www.perl.com/perl/misc/Artistic.html>
117
118 =item Test::use::ok
119
120 To the extent possible under law, 唐鳳 has waived all copyright and related
121 or neighboring rights to L<Test-use-ok>.
122
123 This work is published from Taiwan.
124
125 L<http://creativecommons.org/publicdomain/zero/1.0>
126
127 =item Test::Tester
128
129 This module is copyright 2005 Fergal Daly <fergal@esatclear.ie>, some parts
130 are based on other people's work.
131
132 Under the same license as Perl itself
133
134 See http://www.perl.com/perl/misc/Artistic.html
135
136 =item Test::Builder::Tester
137
138 Copyright Mark Fowler E<lt>mark@twoshortplanks.comE<gt> 2002, 2004.
139
140 This program is free software; you can redistribute it
141 and/or modify it under the same terms as Perl itself.
142
143 =back