1#!./perl 2 3if (! eval { require Test::More; 1 }) { 4 printf "1..1\nok 1 # Test::More not available: skipping %s\n", __FILE__; 5 exit; 6} 7require Test::More; 8Test::More->import(tests => 8); 9 10# use this first to $CPAN::term can be undefined 11use_ok( 'CPAN' ); 12$CPAN::Suppress_readline = $CPAN::Suppress_readline; # silence 13$CPAN::META = $CPAN::META; # silence 14$CPAN::term = $CPAN::term; # silence 15undef $CPAN::term; 16 17# this kicks off all the magic 18use_ok( 'CPAN::Nox' ); 19 20# this will be set if $CPAN::term is undefined 21is( $CPAN::Suppress_readline, 1, 'should set suppress readline flag' ); 22 23# all of these modules have XS components, should be marked unavailable 24my $mod; 25for $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 30is( scalar @CPAN::Nox::EXPORT, scalar @CPAN::EXPORT, 'should export just what CPAN does' ); 31is( \&CPAN::Nox::AUTOLOAD, \&CPAN::AUTOLOAD, 'AUTOLOAD should be aliased' ); 32 33# Local Variables: 34# mode: cperl 35# cperl-indent-level: 2 36# End: 37