Deprecate assignment to $[
[p5sagit/p5-mst-13.2.git] / lib / CPAN / t / 02nox.t
1 #!./perl
2
3 if (! eval { require Test::More; 1 }) {
4   printf "1..1\nok 1 # Test::More not available: skipping %s\n", __FILE__;
5   exit;
6 }
7 require Test::More;
8 Test::More->import(tests => 8);
9
10 # use this first to $CPAN::term can be undefined
11 use_ok( 'CPAN' );
12 $CPAN::Suppress_readline = $CPAN::Suppress_readline; # silence
13 $CPAN::META = $CPAN::META; # silence
14 $CPAN::term = $CPAN::term; # silence
15 undef $CPAN::term;
16
17 # this kicks off all the magic
18 use_ok( 'CPAN::Nox' );
19
20 # this will be set if $CPAN::term is undefined
21 is( $CPAN::Suppress_readline, 1, 'should set suppress readline flag' );
22
23 # all of these modules have XS components, should be marked unavailable
24 my $mod;
25 for $mod (qw( Digest::MD5 LWP Compress::Zlib )) {
26   is( $CPAN::META->has_inst($mod), 0, "$mod should be marked unavailable" );
27 }
28
29 # and these will be set to those in CPAN
30 is( scalar @CPAN::Nox::EXPORT, scalar @CPAN::EXPORT, 'should export just what CPAN does' );
31 is( \&CPAN::Nox::AUTOLOAD, \&CPAN::AUTOLOAD, 'AUTOLOAD should be aliased' );
32
33 # Local Variables:
34 # mode: cperl
35 # cperl-indent-level: 2
36 # End: