summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSisyphus <sisyphus1@optusnet.com.au>2015-08-05 16:53:38 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2015-08-06 18:45:25 -0400
commit5488d3733162ee806bb5f5c55694e8beaaf7b1cc (patch)
treea60bc720543dba2735071f052eaf92bef20a469e /t
parentf3227d3b579a178f48989d54df0601435a177133 (diff)
downloadperl-5488d3733162ee806bb5f5c55694e8beaaf7b1cc.tar.gz
double-double long double %a fixes
- reserve enough buffer space - name the two different errors differently - test around the problem spot
Diffstat (limited to 't')
-rw-r--r--t/op/sprintf2.t21
1 files changed, 20 insertions, 1 deletions
diff --git a/t/op/sprintf2.t b/t/op/sprintf2.t
index 1a4dd3097d..023167b78a 100644
--- a/t/op/sprintf2.t
+++ b/t/op/sprintf2.t
@@ -243,7 +243,7 @@ if ($Config{nvsize} == 8 &&
print "# no hexfloat tests\n";
}
-plan tests => 1408 + ($Q ? 0 : 12) + @hexfloat;
+plan tests => 1408 + ($Q ? 0 : 12) + @hexfloat + 6;
use strict;
use Config;
@@ -648,3 +648,22 @@ for my $t (@hexfloat) {
}
ok($ok, "'$format' '$arg' -> '$result' cf '$expected'");
}
+
+# double-double long double %a special testing.
+SKIP: {
+ skip("$^O doublekind=$Config{doublekind}", 6)
+ unless ($Config{doublekind} == 4 && $^O eq 'linux');
+ # [rt.perl.org 125633]
+ like(sprintf("%La\n", (2**1020) + (2**-1072)),
+ qr/^0x1.0{522}1p\+1020$/);
+ like(sprintf("%La\n", (2**1021) + (2**-1072)),
+ qr/^0x1.0{523}8p\+1021$/);
+ like(sprintf("%La\n", (2**1022) + (2**-1072)),
+ qr/^0x1.0{523}4p\+1022$/);
+ like(sprintf("%La\n", (2**1023) + (2**-1072)),
+ qr/^0x1.0{523}2p\+1023$/);
+ like(sprintf("%La\n", (2**1023) + (2**-1073)),
+ qr/^0x1.0{523}1p\+1023$/);
+ like(sprintf("%La\n", (2**1023) + (2**-1074)),
+ qr/^0x1.0{524}8p\+1023$/);
+}