Commit | Line | Data |
2787609a |
1 | # -*- Mode: cperl; coding: utf-8; -*- |
2 | |
2787609a |
3 | use strict; |
554a9ef5 |
4 | use CPAN::Version; |
2787609a |
5 | use vars qw($D $N); |
6 | |
7 | while (<DATA>) { |
0a78cd5d |
8 | next if tr/.// > 1 && $]<5.006; # multidot tests are not for pre-5.6.0 |
554a9ef5 |
9 | last if /^__END__$/; |
2787609a |
10 | chomp; |
11 | s/\s*#.*//; |
12 | push @$D, [ split ]; |
13 | } |
14 | |
15 | $N = scalar @$D; |
16 | print "1..$N\n"; |
17 | |
18 | while (@$D) { |
19 | my($l,$r,$exp) = @{shift @$D}; |
20 | my $res = CPAN::Version->vcmp($l,$r); |
21 | if ($res != $exp){ |
22 | print "# l[$l]r[$r]exp[$exp]res[$res]\n"; |
23 | print "not "; |
24 | } |
0a78cd5d |
25 | printf "ok %2d # %12s %12s %3d\n", $N-@$D, $l, $r, $res; |
2787609a |
26 | } |
27 | |
28 | __END__ |
29 | 0 0 0 |
30 | 1 0 1 |
31 | 0 1 -1 |
32 | 1 1 0 |
33 | 1.1 0.0a 1 |
34 | 1.1a 0.0 1 |
35 | 1.2.3 1.1.1 1 |
36 | v1.2.3 v1.1.1 1 |
37 | v1.2.3 v1.2.1 1 |
38 | v1.2.3 v1.2.11 -1 |
554a9ef5 |
39 | 1.2.3 1.2.11 -1 |
2787609a |
40 | 1.9 1.10 1 |
41 | VERSION VERSION 0 |
42 | 0.02 undef 1 |
43 | 1.57_00 1.57 1 |
44 | 1.5700 1.57 1 |
45 | 1.57_01 1.57 1 |
554a9ef5 |
46 | 0.2.10 0.2 -1 |
2787609a |
47 | 20000000.00 19990108 1 |
48 | 1.00 0.96 1 |
554a9ef5 |
49 | 0.7.02 0.7 -1 |
2787609a |
50 | 1.3a5 1.3 1 |
51 | undef 1.00 -1 |
52 | v1.0 undef 1 |
53 | v0.2.4 0.24 -1 |
54 | v1.0.22 122 -1 |
55 | 5.00556 v5.5.560 0 |
56 | 5.005056 v5.5.56 0 |
57 | 5.00557 v5.5.560 1 |
58 | 5.00056 v5.0.561 -1 |
554a9ef5 |
59 | 0.0.2 0.000002 0 |
60 | 1.0.3 1.000003 0 |
61 | 1.0.1 1.000001 0 |
62 | 0.0.1 0.000001 0 |
63 | 0.01.04 0.001004 0 |
64 | 0.05.18 0.005018 0 |
65 | 4.08.00 4.008000 0 |
66 | __END__ |
67 | |
68 | # Local Variables: |
69 | # mode: cperl |
70 | # cperl-indent-level: 2 |
71 | # End: |