diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-18 04:17:15 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-18 04:17:15 +0000 |
commit | b695f709e8a342e35e482b0437eb6cdacdc58b6b (patch) | |
tree | 2d16192636e6ba806ff7a907f682c74f7705a920 /lib/CPAN | |
parent | d780cd7a0195e946e636d3ee546f6ef4f21d6acc (diff) | |
download | perl-b695f709e8a342e35e482b0437eb6cdacdc58b6b.tar.gz |
The Grand Trek: move the *.t files from t/ to lib/ and ext/.
No doubt I made some mistakes like missed some files or
misnamed some files. The naming rules were more or less:
(1) if the module is from CPAN, follows its ways, be it
t/*.t or test.pl.
(2) otherwise if there are multiple tests for a module
put them in a t/
(3) otherwise if there's only one test put it in Module.t
(4) helper files go to module/ (locale, strict, warnings)
(5) use longer filenames now that we can (but e.g. the
compat-0.6.t and the Text::Balanced test files still
were renamed to be more civil against the 8.3 people)
installperl was updated appropriately not to install the
*.t files or the help files from under lib.
TODO: some helper files still remain under t/ that could
follow their 'masters'. UPDATE: On second thoughts, why
should they. They can continue to live under t/lib, and
in fact the locale/strict/warnings helpers that were moved
could be moved back. This way the amount of non-installable
stuff under lib/ stays smaller.
p4raw-id: //depot/perl@10676
Diffstat (limited to 'lib/CPAN')
-rw-r--r-- | lib/CPAN/t/loadme.t | 16 | ||||
-rw-r--r-- | lib/CPAN/t/vcmp.t | 62 |
2 files changed, 78 insertions, 0 deletions
diff --git a/lib/CPAN/t/loadme.t b/lib/CPAN/t/loadme.t new file mode 100644 index 0000000000..dce7e1081d --- /dev/null +++ b/lib/CPAN/t/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/lib/CPAN/t/vcmp.t b/lib/CPAN/t/vcmp.t new file mode 100644 index 0000000000..290fc3d206 --- /dev/null +++ b/lib/CPAN/t/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 (<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 |