Update File::Copy tests to skip on OpenBSD, as it mounts too many filesystems nosuid.
[p5sagit/p5-mst-13.2.git] / lib / version.t
index 580ad1e..8067f1a 100644 (file)
@@ -100,6 +100,8 @@ like($@, qr/Invalid version object/,
 sub BaseTests {
 
     my ($CLASS, $method, $qv_declare) = @_;
+    my $warning;
+    local $SIG{__WARN__} = sub { $warning = $_[0] };
     
     # Insert your test code below, the Test module is use()ed here so read
     # its man page ( perldoc Test ) for help writing this test script.
@@ -124,8 +126,9 @@ sub BaseTests {
     is ( "$version" , "5.005" , '5.005 eq "5.005"' );
     $version = $CLASS->$method("5.006.001");
     is ( "$version" , "5.006.001" , '5.006.001 eq v5.6.1' );
-    $version = $CLASS->$method("1.2.3_4");
-    is ( "$version" , "1.2.3_4" , 'alpha version 1.2.3_4 eq v1.2.3_4' );
+    unlike ($warning, qr/v-string without leading 'v' deprecated/, 'No leading v');
+    $version = $CLASS->$method("v1.2.3_4");
+    is ( "$version" , "v1.2.3_4" , 'alpha version 1.2.3_4 eq v1.2.3_4' );
     
     # test illegal formats
     diag "test illegal formats" unless $ENV{PERL_CORE};
@@ -141,7 +144,7 @@ sub BaseTests {
     like($@, qr/alpha without decimal/,
        "Invalid version format (alpha without decimal)");
     
-    # for this first test, just upgrade the warn() to die()
+    # for this test, upgrade the warn() to die()
     eval {
        local $SIG{__WARN__} = sub { die $_[0] };
        $version = $CLASS->$method("1.2b3");
@@ -154,8 +157,6 @@ sub BaseTests {
 
     # from here on out capture the warning and test independently
     {
-    my $warning;
-    local $SIG{__WARN__} = sub { $warning = $_[0] };
     $version = $CLASS->$method("99 and 44/100 pure");
 
     like($warning, qr/$warnregex/,
@@ -227,7 +228,7 @@ sub BaseTests {
     
     $version = $CLASS->$method("1.2.4");
     diag "numeric tests with alpha-style non-objects"
-       if $Verbose;
+       unless $ENV{PERL_CORE};
     ok ( $version > $new_version, '$version > $new_version' );
     ok ( $new_version < $version, '$new_version < $version' );
     ok ( $version != $new_version, '$version != $new_version' );
@@ -251,7 +252,7 @@ sub BaseTests {
     $version = $CLASS->$method("1.2.3.4");
     $new_version = $CLASS->$method("1.2.3_4");
     diag "tests with alpha-style objects with same subversion"
-       if $Verbose;
+       unless $ENV{PERL_CORE};
     ok ( $version > $new_version, '$version > $new_version' );
     ok ( $new_version < $version, '$new_version < $version' );
     ok ( $version != $new_version, '$version != $new_version' );