dslinux/user/perl/lib/CPAN/t Nox.t loadme.t mirroredby.t vcmp.t

cayenne dslinux_cayenne at user.in-berlin.de
Mon Dec 4 18:00:29 CET 2006


Update of /cvsroot/dslinux/dslinux/user/perl/lib/CPAN/t
In directory antilope:/tmp/cvs-serv17422/lib/CPAN/t

Added Files:
	Nox.t loadme.t mirroredby.t vcmp.t 
Log Message:
Adding fresh perl source to HEAD to branch from

--- NEW FILE: loadme.t ---
#!/usr/bin/perl -w

BEGIN {
    print "1..1\n";
}
use strict;
use CPAN;
use CPAN::FirstTime;

print "ok 1\n";


--- NEW FILE: Nox.t ---
#!./perl

use lib "BUNDLE";
use Test::More tests => 8;

# use this first to $CPAN::term can be undefined
use_ok( 'CPAN' );
$CPAN::Suppress_readline = $CPAN::Suppress_readline; # silence
$CPAN::META = $CPAN::META; # silence
$CPAN::term = $CPAN::term; # silence
undef $CPAN::term;

# this kicks off all the magic
use_ok( 'CPAN::Nox' );

# this will be set if $CPAN::term is undefined
is( $CPAN::Suppress_readline, 1, 'should set suppress readline flag' );

# all of these modules have XS components, should be marked unavailable
for my $mod (qw( Digest::MD5 LWP Compress::Zlib )) {
	is( $CPAN::META->has_inst($mod), 0, "$mod should be marked unavailable" );
}

# and these will be set to those in CPAN
is( @CPAN::Nox::EXPORT, @CPAN::EXPORT, 'should export just what CPAN does' );
is( \&CPAN::Nox::AUTOLOAD, \&CPAN::AUTOLOAD, 'AUTOLOAD should be aliased' );

--- NEW FILE: vcmp.t ---
# -*- Mode: cperl; coding: utf-8; -*-

use strict;
use CPAN;
use vars qw($D $N);

while (<DATA>) {
  next if /^v/ && $]<5.006; # v-string tests are not for pre-5.6.0
  chomp;
  s/\s*#.*//;
  push @$D, [ split ];
}

$N = scalar @$D;
print "1..$N\n";

while (@$D) {
  my($l,$r,$exp) = @{shift @$D};
  my $res = CPAN::Version->vcmp($l,$r);
  if ($res != $exp){
    print "# l[$l]r[$r]exp[$exp]res[$res]\n";
    print "not ";
  }
  print "ok ", $N-@$D, "\n";
}

__END__
0 0 0
1 0 1
0 1 -1
1 1 0
1.1 0.0a 1
1.1a 0.0 1
1.2.3 1.1.1 1
v1.2.3 v1.1.1 1
v1.2.3 v1.2.1 1
v1.2.3 v1.2.11 -1
1.2.3 1.2.11 1 # not what they wanted
1.9 1.10 1
VERSION VERSION 0
0.02 undef 1
1.57_00 1.57 1
1.5700 1.57 1
1.57_01 1.57 1
0.2.10 0.2 1
20000000.00 19990108 1
1.00 0.96 1
0.7.02 0.7 1
1.3a5 1.3 1
undef 1.00 -1
v1.0 undef 1
v0.2.4 0.24 -1
v1.0.22 122 -1
5.00556 v5.5.560 0
5.005056 v5.5.56 0
5.00557 v5.5.560 1
5.00056 v5.0.561 -1

--- NEW FILE: mirroredby.t ---
#!/usr/bin/perl -w

BEGIN {
	if ($ENV{PERL_CORE}) {
		chdir 't' if -d 't';
		unshift @INC, '../lib';
	}
}

use strict;
use lib "BUNDLE";
use Test::More tests => 6; 

use_ok( 'CPAN::FirstTime' );
can_ok( 'CPAN::Mirrored::By', 'new', 'continent', 'country', 'url' );
my $cmb = CPAN::Mirrored::By->new();
isa_ok( $cmb, 'CPAN::Mirrored::By' );

@$cmb = qw( continent country url );
is( $cmb->continent(), 'continent',
	'continent() should return continent entry' );
is( $cmb->country(), 'country', 'country() should return country entry' );
is( $cmb->url(), 'url', 'url() should return url entry' );




More information about the dslinux-commit mailing list