1package Test::use::ok; 2use 5.005; 3$Test::use::ok::VERSION = '0.11'; 4 5__END__ 6 7=head1 NAME 8 9Test::use::ok - Alternative to Test::More::use_ok 10 11=head1 SYNOPSIS 12 13 use ok 'Some::Module'; 14 15=head1 DESCRIPTION 16 17According to the B<Test::More> documentation, it is recommended to run 18C<use_ok()> inside a C<BEGIN> block, so functions are exported at 19compile-time and prototypes are properly honored. 20 21That is, instead of writing this: 22 23 use_ok( 'Some::Module' ); 24 use_ok( 'Other::Module' ); 25 26One should write this: 27 28 BEGIN { use_ok( 'Some::Module' ); } 29 BEGIN { use_ok( 'Other::Module' ); } 30 31However, people often either forget to add C<BEGIN>, or mistakenly group 32C<use_ok> with other tests in a single C<BEGIN> block, which can create subtle 33differences in execution order. 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. The explicit space after C<use> 37makes it clear that this is a single compile-time action. 38 39=head1 SEE ALSO 40 41L<Test::More> 42 43=head1 CC0 1.0 Universal 44 45To the extent possible under law, 唐鳳 has waived all copyright and related 46or neighboring rights to L<Test-use-ok>. 47 48This work is published from Taiwan. 49 50L<http://creativecommons.org/publicdomain/zero/1.0> 51 52=cut 53