1Test::use::ok(3)      User Contributed Perl Documentation     Test::use::ok(3)
2
3
4

NAME

6       Test::use::ok - Alternative to Test::More::use_ok
7

SYNOPSIS

9           use ok 'Some::Module';
10

DESCRIPTION

12       According to the Test::More documentation, it is recommended to run
13       "use_ok()" inside a "BEGIN" block, so functions are exported at
14       compile-time and prototypes are properly honored.
15
16       That is, instead of writing this:
17
18           use_ok( 'Some::Module' );
19           use_ok( 'Other::Module' );
20
21       One should write this:
22
23           BEGIN { use_ok( 'Some::Module' ); }
24           BEGIN { use_ok( 'Other::Module' ); }
25
26       However, people often either forget to add "BEGIN", or mistakenly group
27       "use_ok" with other tests in a single "BEGIN" block, which can create
28       subtle differences in execution order.
29
30       With this module, simply change all "use_ok" in test scripts to "use
31       ok", and they will be executed at "BEGIN" time.  The explicit space
32       after "use" makes it clear that this is a single compile-time action.
33

SEE ALSO

35       Test::More
36

MAINTAINER

38       Chad Granum <exodist@cpan.org>
39

CC0 1.0 Universal

41       To the extent possible under law, 唐鳳 has waived all copyright and
42       related or neighboring rights to Test-use-ok.
43
44       This work is published from Taiwan.
45
46       <http://creativecommons.org/publicdomain/zero/1.0>
47
48
49
50perl v5.34.0                      2022-03-05                  Test::use::ok(3)
Impressum