From 2787609acf15f48228c13df6c63c83544ebda559 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 23 Apr 2001 13:32:40 +0000 Subject: [PATCH] Add the CPAN.pm 1.59_54 tests. p4raw-id: //depot/perl@9791 --- MANIFEST | 10 +++++---- t/lib/cpan-loadme.t | 16 ++++++++++++++ t/lib/cpan-vcmp.t | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 t/lib/cpan-loadme.t create mode 100644 t/lib/cpan-vcmp.t diff --git a/MANIFEST b/MANIFEST index 9ee8e96..fb6bb31 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1439,15 +1439,15 @@ t/lib/ansicolor.t See if Term::ANSIColor works t/lib/anydbm.t See if AnyDBM_File works t/lib/attrs.t See if attrs works with C t/lib/autoloader.t See if AutoLoader works -t/lib/b.t See if B works t/lib/b-debug.t See if B::Debug works -t/lib/b-deparse.t See if B::Deparse works -t/lib/b-showlex.t See if B::ShowLex works -t/lib/b-stash.t See if B::Stash works t/lib/b-debug.t See if B::Debug works t/lib/b-deparse.t See if B::Deparse works +t/lib/b-deparse.t See if B::Deparse works +t/lib/b-showlex.t See if B::ShowLex works t/lib/b-showlex.t See if B::ShowLex works t/lib/b-stash.t See if B::Stash works +t/lib/b-stash.t See if B::Stash works +t/lib/b.t See if B works t/lib/basename.t See if File::Basename works t/lib/bigfloat.t See if bigfloat.pl works t/lib/bigfltpm.t See if BigFloat.pm works @@ -1465,6 +1465,8 @@ t/lib/class-isa.t See if Class::ISA works t/lib/class-struct.t See if Class::Struct works t/lib/complex.t See if Math::Complex works t/lib/compmod.pl Helper for 1_compile.t +t/lib/cpan-loadme.t See if CPAN the module works +t/lib/cpan-vcmp.t See if CPAN the module works t/lib/cwd.t See if Cwd works t/lib/db-btree.t See if DB_File works t/lib/db-hash.t See if DB_File works diff --git a/t/lib/cpan-loadme.t b/t/lib/cpan-loadme.t new file mode 100644 index 0000000..dce7e10 --- /dev/null +++ b/t/lib/cpan-loadme.t @@ -0,0 +1,16 @@ +#!/usr/bin/perl -w + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +BEGIN { + print "1..1\n"; +} +use strict; +use CPAN; +use CPAN::FirstTime; + +print "ok 1\n"; + diff --git a/t/lib/cpan-vcmp.t b/t/lib/cpan-vcmp.t new file mode 100644 index 0000000..290fc3d --- /dev/null +++ b/t/lib/cpan-vcmp.t @@ -0,0 +1,62 @@ +# -*- Mode: cperl; coding: utf-8; -*- + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + +use strict; +use CPAN; +use vars qw($D $N); + +while () { + 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 -- 2.7.4