diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-18 00:59:31 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-18 00:59:31 +0000 |
commit | a7e8b12f96bcea99a855092e4b200ddfed6c8c41 (patch) | |
tree | 23b19636a4f664fb37bab11c3dbf9942bd3a6457 /test/ruby | |
parent | d41305b393d1aa33a93dcad15ee1424e24a1a737 (diff) | |
download | ruby-a7e8b12f96bcea99a855092e4b200ddfed6c8c41.tar.gz |
* 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
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_sprintf.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb index 96a1b62bb7..9c4566f8d0 100644 --- a/test/ruby/test_sprintf.rb +++ b/test/ruby/test_sprintf.rb @@ -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 |