Retract #20548 and #20465.
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / use_ok.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     if( $ENV{PERL_CORE} ) {
5         chdir 't';
6         @INC = '../lib';
7     }
8 }
9
10 use Test::More tests => 10;
11
12 # Using Symbol because it's core and exports lots of stuff.
13 {
14     package Foo::one;
15     ::use_ok("Symbol");
16     ::ok( defined &gensym,        'use_ok() no args exports defaults' );
17 }
18
19 {
20     package Foo::two;
21     ::use_ok("Symbol", qw(qualify));
22     ::ok( !defined &gensym,       '  one arg, defaults overriden' );
23     ::ok( defined &qualify,       '  right function exported' );
24 }
25
26 {
27     package Foo::three;
28     ::use_ok("Symbol", qw(gensym ungensym));
29     ::ok( defined &gensym && defined &ungensym,   '  multiple args' );
30 }
31
32 {
33     package Foo::four;
34     my $warn; local $SIG{__WARN__} = sub { $warn .= shift; };
35     ::use_ok("constant", qw(foo bar));
36     ::ok( defined &foo, 'constant' );
37     ::is( $warn, undef, 'no warning');
38 }