This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[rt.perl.org #128889]: printf %a mishandles negative pseudo-precision
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 11 Aug 2016 13:12:04 +0000 (09:12 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 11 Aug 2016 13:36:21 +0000 (09:36 -0400)
(the fix for [rt.perl.org #128888] fixed also this one)

t/op/sprintf2.t

index 0f99fd3..4a157d2 100644 (file)
@@ -262,7 +262,7 @@ if ($Config{nvsize} == 8 &&
     print "# no hexfloat tests\n";
 }
 
-plan tests => 1408 + ($Q ? 0 : 12) + @hexfloat + 40;
+plan tests => 1408 + ($Q ? 0 : 12) + @hexfloat + 41;
 
 use strict;
 use Config;
@@ -807,3 +807,6 @@ SKIP: {
 is(sprintf("%a", 1.03125),   "0x1.08p+0");
 is(sprintf("%.1a", 1.03125), "0x1.0p+0");
 is(sprintf("%.0a", 1.03125), "0x1p+0", "[rt.perl.org #128888]");
+
+# [rt.perl.org #128889]
+is(sprintf("%.*a", -1, 1.03125), "0x1.08p+0", "[rt.perl.org #128889]");