📄 10version.t
字号:
# -*- Mode: cperl; coding: utf-8; -*-use strict;use CPAN::Version;use vars qw($D $N);# for debugging uncomment the next two lines# use CPAN;# $CPAN::DEBUG = 16384;while (<DATA>) { next if tr/.// > 1 && $]<5.006; # multidot tests are not for pre-5.6.0 last if /^__END__$/; chomp; s/\s*#.*//; push @$D, [ split ];}$N = scalar @$D;print "1..$N\n";my $has_sort_versions = eval { require Sort::Versions; 1 };my $has_versionpm = eval q{ use version 0.7203; 1 };my $has_perl_versionpm = eval { require Perl::Version; 1 };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 "; } my @other = (); if ($has_sort_versions) { if (Sort::Versions::versioncmp($l,$r) != $res) { push @other, sprintf "SV: %d", Sort::Versions::versioncmp($l,$r); } } if ($has_versionpm) { local $^W; my $vpack = "version"; # hide the name from 5.004 my $vres = eval { $vpack->new($l) cmp $vpack->new($r); }; if ($@) { push @other, "v.pm: $@"; } elsif ($vres != $res) { push @other, sprintf "v.pm: %d", $vres; } } if ($has_perl_versionpm) { local $^W; my $vpack = "Perl::Version"; # hide the name from 5.004 my $vres = eval { $vpack->new($l) cmp $vpack->new($r); }; if ($@) { push @other, "PV: $@"; } elsif ($vres != $res) { push @other, sprintf "PV: %d", $vres; } } my $other = @other ? " (".join("; ", @other).")" : ""; printf "ok %2d # %12s %12s %3d%s\n", $N-@$D, $l, $r, $res, $other; die "Panic" if CPAN::Version->vgt($l,$r) && CPAN::Version->vlt($l,$r);}__END__0 0 01 0 10 1 -11 1 01.1 0.0a 11.1a 0.0 11.2.3 1.1.1 1v1.2.3 v1.1.1 1v1.2.3 v1.2.1 1v1.2.3 v1.2.11 -1v2.4 2.004000 -1v2.4 2.004 01.2.3 1.2.11 -11.9 1.10 1VERSION VERSION 00.02 undef 11.57_00 1.57 11.5700 1.57 11.57_01 1.57 11.88_51 1.8801 11.8_8_5_1 1.8801 10.2.10 0.2 -120000000.00 19990108 11.00 0.96 10.7.2 0.7 -10.7.02 0.7 -10.07.02 0.7 -11.3a5 1.3 1undef 1.00 -1v1.0 undef 1v0.2.4 0.24 -1v1.0.22 122 -11.0.22 122 -15.00556 v5.5.560 05.005056 v5.5.56 05.00557 v5.5.560 15.00056 v5.0.561 -10.0.2 0.000002 01.0.3 1.000003 01.0.1 1.000001 00.0.1 0.000001 00.01.04 0.001004 00.05.18 0.005018 04.08.00 4.008000 00.001.004 0.001004 00.005.018 0.005018 04.008.000 4.008000 04.008.000 4.008 1v4.8 4.008 0v4.8.0 4.008000 0v1.99.1_1 1.98 -1v2.3999 v2.4000 -1v2.3999 2.004000 1v2.3999 2.999999 1v2.1000 2.999999 10123 123 -1v2.005 2.005 0v1.0 1.0 0v1.0 1.000 0v1.0 1.000000 0__END__# Local Variables:# mode: cperl# cperl-indent-level: 2# End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -