* sprintf.c (BSD_vfprintf): wrong padding arround prefix and

floating point with %a. [ruby-dev:42403] Bug #3956

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-10-18 00:59:31 +00:00
parent d41305b393
commit a7e8b12f96
3 changed files with 15 additions and 0 deletions

View file

@ -204,6 +204,13 @@ class TestSprintf < Test::Unit::TestCase
assert_equal("Inf", sprintf("%E", Float::INFINITY))
assert_equal("NaN", sprintf("%e", Float::NAN))
assert_equal("NaN", sprintf("%E", Float::NAN))
assert_equal(" -0x1p+0", sprintf("%10a", -1))
assert_equal(" -0x1.8p+0", sprintf("%10a", -1.5))
assert_equal(" -0x1.4p+0", sprintf("%10a", -1.25))
assert_equal(" -0x1.2p+0", sprintf("%10a", -1.125))
assert_equal(" -0x1.1p+0", sprintf("%10a", -1.0625))
assert_equal("-0x1.05p+0", sprintf("%10a", -1.03125))
end
BSIZ = 120