This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
move back to a stable Test-Simple, v1.001014
[perl5.git] / cpan / Test-Simple / lib / ok.pm
CommitLineData
518760d9 1package ok;
afad11a2 2$ok::VERSION = '0.16';
518760d9 3
afad11a2
RS
4use strict;
5use Test::More ();
518760d9
CG
6
7sub import {
8 shift;
9
10 if (@_) {
518760d9
CG
11 goto &Test::More::pass if $_[0] eq 'ok';
12 goto &Test::More::use_ok;
13 }
afad11a2
RS
14
15 # No argument list - croak as if we are prototyped like use_ok()
16 my (undef, $file, $line) = caller();
17 ($file =~ /^\(eval/) or die "Not enough arguments for 'use ok' at $file line $line\n";
518760d9
CG
18}
19
518760d9
CG
20
21__END__
22
518760d9
CG
23=head1 NAME
24
25ok - Alternative to Test::More::use_ok
26
27=head1 SYNOPSIS
28
29 use ok 'Some::Module';
30
31=head1 DESCRIPTION
32
33With this module, simply change all C<use_ok> in test scripts to C<use ok>,
34and they will be executed at C<BEGIN> time.
35
36Please see L<Test::use::ok> for the full description.
37
afad11a2 38=head1 CC0 1.0 Universal
518760d9
CG
39
40To the extent possible under law, 唐鳳 has waived all copyright and related
41or neighboring rights to L<Test-use-ok>.
42
43This work is published from Taiwan.
44
45L<http://creativecommons.org/publicdomain/zero/1.0>
46
afad11a2 47=cut