Commit | Line | Data |
149e6985 |
1 | #!./perl |
2 | |
0a78cd5d |
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); |
149e6985 |
9 | |
10 | # use this first to $CPAN::term can be undefined |
11 | use_ok( 'CPAN' ); |
5fc0f0f6 |
12 | $CPAN::Suppress_readline = $CPAN::Suppress_readline; # silence |
13 | $CPAN::META = $CPAN::META; # silence |
14 | $CPAN::term = $CPAN::term; # silence |
149e6985 |
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 |
0a78cd5d |
24 | my $mod; |
25 | for $mod (qw( Digest::MD5 LWP Compress::Zlib )) { |
149e6985 |
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 |
0a78cd5d |
30 | is( scalar @CPAN::Nox::EXPORT, scalar @CPAN::EXPORT, 'should export just what CPAN does' ); |
149e6985 |
31 | is( \&CPAN::Nox::AUTOLOAD, \&CPAN::AUTOLOAD, 'AUTOLOAD should be aliased' ); |
554a9ef5 |
32 | |
33 | # Local Variables: |
34 | # mode: cperl |
35 | # cperl-indent-level: 2 |
36 | # End: |