use Config;
require "test.pl";
-plan( tests => 50 );
+plan( tests => 53 );
-eval { use v5.5.640; };
+eval 'use v5.5.640';
is( $@, '', "use v5.5.640; $@");
require_ok('v5.5.640');
#
# now do the same without the "v"
-eval { use 5.5.640; };
+eval 'use 5.5.640';
is( $@, '', "use 5.5.640; $@");
require_ok('5.5.640');
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";
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)
$v = v1.2_3;
is( ref(\$v), 'VSTRING', 'v-string objects with v' );
is( sprintf("%vd", $v), '1.23', 'v-string ignores underscores' );
+
+# [perl #16010]
+%h = (v65 => 42);
+ok( exists $h{v65}, "v-stringness is not engaged for vX" );
+%h = (v65.66 => 42);
+ok( exists $h{chr(65).chr(66)}, "v-stringness is engaged for vX.Y" );
+%h = (65.66.67 => 42);
+ok( exists $h{chr(65).chr(66).chr(67)}, "v-stringness is engaged for X.Y.Z" );
+
+