ver.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
BEGIN {
chdir 't' if -d 't';
}
$DOWARN = 1; # enable run-time warnings now
use Config;
eval 'use v5.5.640';
# printing characters should work
# hash keys too
}
else { # EBCDIC
# hash keys too
}
# poetry optimization should also
$x = v77;
# but not when dots are involved
$x = v77.78.79;
}
else {
$x = v212.213.214;
}
#
# now do the same without the "v"
eval 'use 5.5.640';
# hash keys too
$h{111.107.32} = "ok";
}
else {
$h{150.146.64} = "ok";
}
$x = 77.78.79;
}
else {
$x = 212.213.214;
}
# test sprintf("%vd"...) etc
}
else {
}
}
else {
}
}
else {
}
'1##10110##101001101##1000101011100', 'sprintf("%vb", 1.22.333.4444)');
{
use bytes;
}
else {
}
is(sprintf("%vd", 1.22.333.4444), '1.22.197.141.225.133.156', 'ASCII sprintf("%vd", v1.22.333.4444 w/use bytes');
}
else {
is(sprintf("%vd", 1.22.333.4444), '1.22.142.84.187.81.112', 'EBCDIC sprintf("%vd", v1.22.333.4444 w/use bytes');
}
}
else {
}
}
else {
}
}
else {
}
'1##10110##11000101##10001101##11100001##10000101##10011100',
'ASCII sprintf("%*vb", "##", v1.22.333.4444)');
}
else {
'1##10110##10001110##1010100##10111011##1010001##1110000',
'EBCDIC sprintf("%*vb", "##", v1.22.333.4444)');
}
}
{
# bug id 20000323.056
}
# See if the things Camel-III says are true: 29..33
# Chapter 2 pp67/68
# Chapter 15, pp403
# See if sane addr and gethostbyaddr() work
if ($@) {
# No - so do not test insane fails.
$@ =~ s/\n/\n# /g;
}
SKIP: {
my $host;
}
# Chapter 28, pp671
# part of 20000323.059
print "# v = '$v'\n";
print "# ] = '$]'\n";
$v =~ s/000$// if $subversion == 0;
print "# v = '$v'\n";
$v = $revision + $version/1000 + $subversion/1000000;
SKIP: {
# [ID 20010902.001] check if v-strings handle full UV range or not
is( sprintf("%vd", eval 'v2147483647.2147483648'), '2147483647.2147483648', 'v-string > IV_MAX[32-bit]' );
}
SKIP: {
is( sprintf("%vd", eval 'v9223372036854775807.9223372036854775808'), '9223372036854775807.9223372036854775808', 'v-string > IV_MAX[64-bit]' );
is( sprintf("%vd", eval 'v17446744073709551615'), '17446744073709551615', 'IV_MAX < v-string < UV_MAX[64-bit]');
is( sprintf("%vd", eval 'v18446744073709551615'), '18446744073709551615', 'v-string == UV_MAX[64-bit] - 1');
}
}
}
# Tests for magic v-strings
$v = 1.2.3;
# [perl #16010]
%h = (65.66.67 => 42);