1 # -*- Mode: cperl; coding: utf-8; -*-
7 # for debugging uncomment the next two lines
9 # $CPAN::DEBUG = 16384;
12 next if tr/.// > 1 && $]<5.006; # multidot tests are not for pre-5.6.0
22 my $has_sort_versions = eval { require Sort::Versions; 1 };
23 my $has_versionpm = eval q{ use version 0.7203; 1 };
24 my $has_perl_versionpm = eval { require Perl::Version; 1 };
26 my($l,$r,$exp) = @{shift @$D};
27 my $res = CPAN::Version->vcmp($l,$r);
29 print "# l[$l]r[$r]exp[$exp]res[$res]\n";
33 if ($has_sort_versions) {
34 if (Sort::Versions::versioncmp($l,$r) != $res) {
35 push @other, sprintf "SV: %d", Sort::Versions::versioncmp($l,$r);
40 my $vpack = "version"; # hide the name from 5.004
41 my $vres = eval { $vpack->new($l) cmp $vpack->new($r); };
43 push @other, "v.pm: $@";
44 } elsif ($vres != $res) {
45 push @other, sprintf "v.pm: %d", $vres;
48 if ($has_perl_versionpm) {
50 my $vpack = "Perl::Version"; # hide the name from 5.004
51 my $vres = eval { $vpack->new($l) cmp $vpack->new($r); };
53 push @other, "PV: $@";
54 } elsif ($vres != $res) {
55 push @other, sprintf "PV: %d", $vres;
58 my $other = @other ? " (".join("; ", @other).")" : "";
59 printf "ok %2d # %12s %12s %3d%s\n", $N-@$D, $l, $r, $res, $other;
60 die "Panic" if CPAN::Version->vgt($l,$r) && CPAN::Version->vlt($l,$r);
86 20000000.00 19990108 1
128 # cperl-indent-level: 2