Change 33765 by rgs@scipion on 2008/04/30 07:47:07
Subject: [PATCH] extra tests for t/op/sprintf2.t (was Re: [perl #45383] RE:
From: Bram <p5p@perl.wizbit.be>
Date: Tue, 29 Apr 2008 22:27:21 +0200
Message-ID: <20080429222721.rwupydwjk00okwc0@horde.wizbit.be>
Affected files ...
... //depot/perl/t/op/sprintf2.t#11 edit
Differences ...
==== //depot/perl/t/op/sprintf2.t#11 (text) ====
Index: perl/t/op/sprintf2.t
--- perl/t/op/sprintf2.t#10~29025~ 2006-10-16 02:26:17.000000000 -0700
+++ perl/t/op/sprintf2.t 2008-04-30 00:47:07.000000000 -0700
@@ -6,7 +6,7 @@
require './test.pl';
}
-plan tests => 1292;
+plan tests => 1295;
is(
sprintf("%.40g ",0.01),
@@ -134,3 +134,8 @@
}
}
+# test that %f doesn't panic with +Inf, -Inf, NaN [perl #45383]
+foreach my $n (2**1e100, -2**1e100, 2**1e100/2**1e100) { # +Inf, -Inf, NaN
+ eval { my $f = sprintf("%f", $n); };
+ is $@, "", "sprintf(\"%f\", $n)";
+}
End of Patch.