Test::Simple/More/Builder 0.42 -> 0.44
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / use_ok.t
CommitLineData
89c1e84a 1#!/usr/bin/perl -w
2
33459055 3BEGIN {
a9153838 4 if( $ENV{PERL_CORE} ) {
5 chdir 't';
6 @INC = '../lib';
7 }
33459055 8}
9
89c1e84a 10use Test::More tests => 10;
33459055 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}
89c1e84a 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}