This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Sync cpan/Test-Simple with CPAN version 1.302111.
[perl5.git] / cpan / Test-Simple / lib / ok.pm
CommitLineData
518760d9 1package ok;
7358a033 2our $VERSION = '1.302111';
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
b4514920
CG
23=encoding UTF-8
24
518760d9
CG
25=head1 NAME
26
27ok - Alternative to Test::More::use_ok
28
29=head1 SYNOPSIS
30
31 use ok 'Some::Module';
32
33=head1 DESCRIPTION
34
35With this module, simply change all C<use_ok> in test scripts to C<use ok>,
36and they will be executed at C<BEGIN> time.
37
38Please see L<Test::use::ok> for the full description.
39
afad11a2 40=head1 CC0 1.0 Universal
518760d9
CG
41
42To the extent possible under law, 唐鳳 has waived all copyright and related
43or neighboring rights to L<Test-use-ok>.
44
45This work is published from Taiwan.
46
47L<http://creativecommons.org/publicdomain/zero/1.0>
48
afad11a2 49=cut