use strict;
use warnings;
-use Test::More tests => 3 + (2 + 2 * 3) * (52 + 4 * 7);
+use Test::More tests => 3 + (2 + 2 * 3) * (66 + 4 * 7);
use CPANPLUS::Dist::Gentoo::Version;
my @tests = (
[ 0, 0 => 0 ],
[ 1, 0 => 1 ],
- [ 0, 1 => -1 ],
[ 1, 1 => 0 ],
+ [ '00', '0' => 0 ],
+ [ '01', '1' => 0 ],
+ [ '001', '1' => 0 ],
+ [ '001', '01' => 0 ],
+
[ '1.0', 1 => 1 ], # Yes, 1.0 > 1. Deal with it
[ '1.0', '1.0' => 0 ],
[ '1.1', 1 => 1 ],
[ '1.1', '1.0' => 1 ],
- [ '1.0', '1.1' => -1 ],
- [ '1.0.0', 1 => 1 ], # Ditto
- [ '1.0.0', '1.0' => 1 ], # Tritto
- [ '1.0.0', '1.0.0' => 0 ],
- [ '1.0.1', '1.1' => -1 ],
- [ '1.0.1', '1.0.0' => 1 ],
-
- [ '1a', 1 => 1 ],
- [ '1.0a', 1 => 1 ],
- [ '1.0', '1a' => 1 ], # Same
- [ '1a', '1b' => -1 ],
- [ '1.1a', '1.0b' => 1 ],
+ [ '1.1', '1.1' => 0 ],
+ [ '1.1', '1.10' => -1 ],
+ [ '1.1', '1.01' => 1 ],
+ [ '1.1', '1.010' => 1 ],
+ [ '1.01', '1.010' => 0 ],
+
+ [ '1.0.0', 1 => 1 ], # Ditto
+ [ '1.0.0', '1.0' => 1 ], # Tritto
+ [ '1.0.0', '1.0.0' => 0 ],
+ [ '1.0.1', '1.1' => -1 ],
+ [ '1.0.1', '1.0.0' => 1 ],
+ [ '1.0.1', '1.0.1' => 0 ],
+ [ '1.0.1', '1.0.10' => -1 ],
+ [ '1.0.1', '1.0.01' => 1 ],
+ [ '1.0.1', '1.0.010' => 1 ],
+ [ '1.0.01', '1.0.010' => 0 ],
+
+ [ '1a', 1 => 1 ],
+ [ '1.0a', 1 => 1 ],
+ [ '1.0', '1a' => 1 ], # Same
+ [ '1a', '1b' => -1 ],
+ [ '1.1a', '1.0b' => 1 ],
+ [ '1.1a', '1.01a' => 1 ],
+ [ '1.01a', '1.010a' => 0 ],
map( {
[ '1.0', "1.0_${_}" => 1 ],