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