diff options
author | John Peacock <jpeacock@rowman.com> | 2004-04-06 17:56:19 -0400 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-04-07 08:00:07 +0000 |
commit | b9381830ea61ec067aab6d500e359e6a80e285b6 (patch) | |
tree | 00bd740237c0cd7f92b34436e00b3abc25ff339f /lib/version.t | |
parent | e3c9a8b9e0e8ab67833a50cc3f37939286b04437 (diff) | |
download | perl-b9381830ea61ec067aab6d500e359e6a80e285b6.tar.gz |
Bleadperl to version 0.37
Message-ID: <40735FC3.5010305@rowman.com>
p4raw-id: //depot/perl@22668
Diffstat (limited to 'lib/version.t')
-rw-r--r-- | lib/version.t | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/version.t b/lib/version.t index ecf9f46c95..dd8cb67300 100644 --- a/lib/version.t +++ b/lib/version.t @@ -4,7 +4,7 @@ ######################### -use Test::More tests => 166; +use Test::More tests => 164; diag "Tests with base class" unless $ENV{PERL_CORE}; @@ -43,7 +43,7 @@ sub BaseTests { $version = $CLASS->new(5.005_03); is ( "$version" , "5.5.30" , '5.005_03 eq 5.5.30' ); $version = $CLASS->new(1.23); - is ( "$version" , "1.230.0" , '1.23 eq "1.230.0"' ); + is ( "$version" , "1.23" , '1.23 eq "1.23"' ); # Test quoted number processing diag "tests with quoted numbers" unless $ENV{PERL_CORE}; @@ -55,7 +55,7 @@ sub BaseTests { # Test stringify operator diag "tests with stringify" unless $ENV{PERL_CORE}; $version = $CLASS->new("5.005"); - is ( "$version" , "5.5.0" , '5.005 eq 5.5' ); + is ( "$version" , "5.005" , '5.005 eq "5.005"' ); $version = $CLASS->new("5.006.001"); is ( "$version" , "5.6.1" , '5.006.001 eq 5.6.1' ); $version = $CLASS->new("1.2.3_4"); @@ -72,7 +72,7 @@ sub BaseTests { "Invalid version format (underscores before decimal)"); $version = $CLASS->new("99 and 44/100 pure"); - ok ("$version" eq "99.0.0", '$version eq "99.0.0"'); + ok ("$version" eq "99", '$version eq "99.0.0"'); ok ($version->numify == 99.0, '$version->numify == 99.0'); $version = $CLASS->new("something"); @@ -223,7 +223,7 @@ sub BaseTests { # we know this file is here since we require it ourselves $version = $CLASS->new( $Test::More::VERSION ); eval "use Test::More $version"; - unlike($@, qr/Test::More version $version required/, + unlike($@, qr/Test::More version $version/, 'Replacement eval works with exact version'); $version = $CLASS->new( $Test::More::VERSION+0.01 ); # this should fail even with old UNIVERSAL::VERSION @@ -231,22 +231,22 @@ sub BaseTests { ( $]<5.6 ? $version->numify() #why is this a problem??? : $version ); eval $testeval; - like($@, qr/Test::More version $version required/, + like($@, qr/Test::More version $version/, 'Replacement eval works with incremented version'); - $version =~ s/...$//; #convert to string and remove trailing '.0' + $version =~ s/\.0$//; #convert to string and remove trailing '.0' chop($version); # shorten by 1 digit, should still succeed eval "use Test::More $version"; - unlike($@, qr/Test::More version $version required/, + unlike($@, qr/Test::More version $version/, 'Replacement eval works with single digit'); $version += 0.1; # this would fail with old UNIVERSAL::VERSION eval "use Test::More $version"; - unlike($@, qr/Test::More version $version required/, + like($@, qr/Test::More version $version/, 'Replacement eval works with incremented digit'); SKIP: { - skip 'Cannot test v-strings with Perl < 5.8.1', 5 + skip 'Cannot test v-strings with Perl < 5.8.1', 4 if $] < 5.008_001; diag "Tests with v-strings" unless $ENV{PERL_CORE}; $version = $CLASS->new(1.2.3); @@ -255,7 +255,6 @@ SKIP: { $new_version = $CLASS->new(1); ok($version == $new_version, '$version == $new_version'); ok($version eq $new_version, '$version eq $new_version'); - ok("$version" eq "$new_version", '"$version" eq "$new_version"'); $version = qv(1.2.3); ok("$version" eq "1.2.3", 'v-string initialized qv()'); } |