1package ok;
2$ok::VERSION = '0.11';
3
4use strict;
5use Test::More ();
6
7sub import {
8    shift;
9
10    if (@_) {
11        goto &Test::More::pass if $_[0] eq 'ok';
12        goto &Test::More::use_ok;
13    }
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";
18}
19
20
21__END__
22
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
38=head1 CC0 1.0 Universal
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
47=cut
48