More tests
[p5sagit/p5-mst-13.2.git] / t / op / ver.t
index 79c36b6..d6b93e0 100755 (executable)
@@ -203,7 +203,10 @@ is(v200, eval( "v200"), 'v200 eq "v200"'        );
 is(v200, eval("+v200"), 'v200 eq eval("+v200")' );
 
 # Tests for string/numeric value of $] itself
-my ($revision,$version,$subversion) = split '\.', sprintf("%vd",$^V);
+my ($revision,$version,$subversion) = split /\./, sprintf("%vd",$^V);
+
+# $^V always displays the leading 'v' but we don't want that here
+$revision =~ s/^v//;
 
 print "# revision   = '$revision'\n";
 print "# version    = '$version'\n";
@@ -214,15 +217,11 @@ my $v = sprintf("%d.%.3d%.3d",$revision,$version,$subversion);
 print "# v = '$v'\n";
 print "# ] = '$]'\n";
 
-$v =~ s/000$// if $subversion == 0;
-
-print "# v = '$v'\n";
-
-ok( $v eq "$]", qq{\$^V eq "\$]"});
+is( $v, "$]", qq{\$^V eq "\$]"});
 
 $v = $revision + $version/1000 + $subversion/1000000;
 
-ok( $v == $], "\$^V == \$] (numeric)" );
+ok( abs($v - $]) < 10**-8 , "\$^V == \$] (numeric)" );
 
 SKIP: {
   skip("In EBCDIC the v-string components cannot exceed 2147483647", 6)