diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-19 08:58:08 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-19 08:58:08 +0000 |
commit | ac0e6a2fd2970df72270aecb94d407fe170b43a7 (patch) | |
tree | d8b04099761e9ec4c10f6d39c5d2435b45f3bf50 /lib/version.t | |
parent | b01e650a9b9106d610923bb01ce97b6e191ca8ed (diff) | |
download | perl-ac0e6a2fd2970df72270aecb94d407fe170b43a7.tar.gz |
Upgrade to version.pm 0.71, by John Peacock
p4raw-id: //depot/perl@30629
Diffstat (limited to 'lib/version.t')
-rw-r--r-- | lib/version.t | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/lib/version.t b/lib/version.t index 2438a30b8f..11a6b07e46 100644 --- a/lib/version.t +++ b/lib/version.t @@ -400,8 +400,8 @@ SKIP: { } SKIP: { - skip 'Cannot test bare v-strings with Perl < 5.8.1', 4 - if $] < 5.008_001; + skip 'Cannot test bare v-strings with Perl < 5.6.0', 4 + if $] < 5.006_000; diag "Tests with v-strings" if $Verbose; $version = $CLASS->new(1.2.3); ok("$version" eq "v1.2.3", '"$version" eq 1.2.3'); @@ -468,26 +468,26 @@ EOF close F; eval "use lib '.'; use www 0.000008;"; - like ($@, qr/^www version 0.000008 \(v0.0.8\) required/, + like ($@, qr/^www version 0.000008 required/, "Make sure very small versions don't freak"); eval "use lib '.'; use www 1;"; - like ($@, qr/^www version 1.000 \(v1.0.0\) required/, + like ($@, qr/^www version 1.000 required/, "Comparing vs. version with no decimal"); eval "use lib '.'; use www 1.;"; - like ($@, qr/^www version 1.000 \(v1.0.0\) required/, + like ($@, qr/^www version 1.000 required/, "Comparing vs. version with decimal only"); - if ( $] < 5.006_002 ) { + if ( $] < 5.006_000 ) { unlink 'www.pm'; - skip 'Cannot "use" extended versions with Perl < 5.6.2', 3; + skip 'Cannot "use" extended versions with Perl < 5.6.0', 3; } - eval "use lib '.'; use www 0.0.8;"; - like ($@, qr/^www version 0.000008 \(v0.0.8\) required/, - "Make sure very small versions don't freak"); + eval "use lib '.'; use www v0.0.8;"; + my $regex = "^www version v0.0.8 required"; + like ($@, qr/$regex/, "Make sure very small versions don't freak"); - eval "use lib '.'; use www 0.0.4;"; - unlike($@, qr/^www version 0.000004 \(v0.0.4\) required/, - 'Succeed - required == VERSION'); + $regex =~ s/8/4/; # set for second test + eval "use lib '.'; use www v0.0.4;"; + unlike($@, qr/$regex/, 'Succeed - required == VERSION'); cmp_ok ( "www"->VERSION, 'eq', '0.000004', 'No undef warnings' ); unlink 'www.pm'; @@ -509,6 +509,26 @@ EOF unlink 'vvv.pm'; SKIP: { + if ( $] < 5.006_000 ) { + skip 'Cannot "use" extended versions with Perl < 5.6.0', 3; + } + open F, ">uuu.pm" or die "Cannot open uuu.pm: $!\n"; + print F <<"EOF"; +package uuu; +\$VERSION = 1.0; +1; +EOF + close F; + eval "use lib '.'; use uuu 1.001;"; + like ($@, qr/^uuu version 1.001 required/, + "User typed numeric so we error with numeric"); + eval "use lib '.'; use uuu v1.1.0;"; + like ($@, qr/^uuu version v1.1.0 required/, + "User typed extended so we error with extended"); + unlink 'uuu.pm'; + } + +SKIP: { # test locale handling my $warning; local $SIG{__WARN__} = sub { $warning = $_[0] }; @@ -534,6 +554,7 @@ SKIP: { eval 'my $v = $CLASS->new("1._1");'; unlike($@, qr/^Invalid version format \(alpha with zero width\)/, "Invalid version format 1._1"); + } 1; |