diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-01 00:38:33 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-01 00:38:33 +0000 |
| commit | 14d2feb6590e91c4e24fb38097bb20240c65f915 (patch) | |
| tree | 5daeb4db319ee3792f293aa0257021478b4a1038 /test/ruby/test_sprintf_comb.rb | |
| parent | 3e6c35c6600ed0f96c4fbcf9204d9de2afd19cba (diff) | |
| download | ruby-14d2feb6590e91c4e24fb38097bb20240c65f915.tar.gz ruby-14d2feb6590e91c4e24fb38097bb20240c65f915.tar.xz ruby-14d2feb6590e91c4e24fb38097bb20240c65f915.zip | |
* sprintf.c (rb_str_format): "%#.0o" should keep prefix where
"%#.0x" should not.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_sprintf_comb.rb')
| -rw-r--r-- | test/ruby/test_sprintf_comb.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/ruby/test_sprintf_comb.rb b/test/ruby/test_sprintf_comb.rb index ee748f765..644a1dd0f 100644 --- a/test/ruby/test_sprintf_comb.rb +++ b/test/ruby/test_sprintf_comb.rb @@ -145,7 +145,7 @@ class TestSprintfComb < Test::Unit::TestCase radix = 2 digitmap = {0 => '0', 1 => '1'} complement = !pl && !sp - prefix = '0b' if hs + prefix = '0b' if hs && v != 0 when 'd' radix = 10 digitmap = {} @@ -161,13 +161,13 @@ class TestSprintfComb < Test::Unit::TestCase digitmap = {} 16.times {|i| digitmap[i] = i.to_s(16).upcase } complement = !pl && !sp - prefix = '0X' if hs + prefix = '0X' if hs && v != 0 when 'x' radix = 16 digitmap = {} 16.times {|i| digitmap[i] = i.to_s(16) } complement = !pl && !sp - prefix = '0x' if hs + prefix = '0x' if hs && v != 0 else raise "unexpected type: #{type.inspect}" end |
