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