}
use warnings;
use Config;
+use strict;
-# strictness
my @tests = ();
my ($i, $template, $data, $result, $comment, $w, $x, $evalData, $n, $p);
-while (<DATA>) {
- s/^\s*>//; s/<\s*$//;
- push @tests, [split(/<\s*>/, $_, 4)];
-}
-
-print '1..', scalar @tests, "\n";
-
-$SIG{__WARN__} = sub {
- if ($_[0] =~ /^Invalid conversion/) {
- $w = ' INVALID';
- } elsif ($_[0] =~ /^Use of uninitialized value/) {
- $w = ' UNINIT';
- } else {
- warn @_;
- }
-};
-
my $Is_VMS_VAX = 0;
# We use HW_MODEL since ARCH_NAME was not in VMS V5.*
if ($^O eq 'VMS') {
# No %Config.
my $Is_Ultrix_VAX = $^O eq 'ultrix' && `uname -m` =~ /^VAX$/;
-for ($i = 1; @tests; $i++) {
- ($template, $data, $result, $comment) = @{shift @tests};
+while (<DATA>) {
+ s/^\s*>//; s/<\s*$//;
+ ($template, $data, $result, $comment) = split(/<\s*>/, $_, 4);
if ($^O eq 'os390' || $^O eq 's390') { # non-IEEE (s390 is UTS)
$data =~ s/([eE])96$/${1}63/; # smaller exponents
$result =~ s/([eE]\+)102$/${1}69/; # " "
$data =~ s/([eE])\-101$/${1}-24/; # larger exponents
$result =~ s/([eE])\-102$/${1}-25/; # " "
}
+ push @tests, [$template, $data, $result, $comment];
+}
+
+print '1..', scalar @tests, "\n";
+
+$SIG{__WARN__} = sub {
+ if ($_[0] =~ /^Invalid conversion/) {
+ $w = ' INVALID';
+ } elsif ($_[0] =~ /^Use of uninitialized value/) {
+ $w = ' UNINIT';
+ } else {
+ warn @_;
+ }
+};
+
+for ($i = 1; @tests; $i++) {
+ ($template, $data, $result, $comment) = @{shift @tests};
$evalData = eval $data;
$w = undef;
$x = sprintf(">$template<",
>%*2*2$d< >[12, 3]< >%*2*2$d INVALID<
>%*2$1d< >[12, 3]< >%*2$1d INVALID<
>%0v2.2d< >''< ><
->%vc,%d< >[63, 64, 65]< >?,64<
+>%vc,%d< >[63, 64, 65]< >%vc,63 INVALID<
+>%v%,%d< >[63, 64, 65]< >%v%,63 INVALID<
>%vd,%d< >[1, 2, 3]< >49,2<
->%vf,%d< >[1, 2, 3]< >1.000000,2<
+>%vf,%d< >[1, 2, 3]< >%vf,1 INVALID<
+>%vF,%d< >[1, 2, 3]< >%vF,1 INVALID<
+>%ve,%d< >[1, 2, 3]< >%ve,1 INVALID<
+>%vE,%d< >[1, 2, 3]< >%vE,1 INVALID<
+>%vg,%d< >[1, 2, 3]< >%vg,1 INVALID<
+>%vG,%d< >[1, 2, 3]< >%vG,1 INVALID<
>%vp< >''< >%vp INVALID<
->%vs,%d< >[1, 2, 3]< >1,2<
+>%vn< >''< >%vn INVALID<
+>%vs,%d< >[1, 2, 3]< >%vs,1 INVALID<
>%v_< >''< >%v_ INVALID<
>%v#x< >''< >%v#x INVALID<
>%v02x< >"foo\012"< >66.6f.6f.0a<
>%4$K %d< >[45, 67]< >%4$K 45 INVALID<
>%d %K %d< >[23, 45]< >23 %K 45 INVALID<
>%*v*999\$d %d %d< >[11, 22, 33]< >%*v*999\$d 11 22 INVALID<
+>%#b< >0< >0<
+>%#o< >0< >0<
+>%#x< >0< >0<
+>%2918905856$v2d< >''< ><
+>%*2918905856$v2d< >''< > UNINIT<