summaryrefslogtreecommitdiff
path: root/test/ruby/test_sprintf_comb.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-14 14:08:36 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-14 14:08:36 +0000
commit4dbc8e24542e39b627e3546a58aabf59462c9c7d (patch)
tree41867cc11c9a1ef53d2dad076eb0661178b11e06 /test/ruby/test_sprintf_comb.rb
parent80cdf946f7c3fb2e74b778f9bb2f4807d50a33d2 (diff)
add test for %B.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_sprintf_comb.rb')
-rw-r--r--test/ruby/test_sprintf_comb.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_sprintf_comb.rb b/test/ruby/test_sprintf_comb.rb
index 8b2c1a7e05..5dee7305fb 100644
--- a/test/ruby/test_sprintf_comb.rb
+++ b/test/ruby/test_sprintf_comb.rb
@@ -131,6 +131,11 @@ class TestSprintfComb < Test::Unit::TestCase
zr = nil if mi && zr
case type
+ when 'B'
+ radix = 2
+ digitmap = {0 => '0', 1 => '1'}
+ complement = !pl && !sp
+ prefix = '0B' if hs && v != 0
when 'b'
radix = 2
digitmap = {0 => '0', 1 => '1'}
@@ -265,7 +270,7 @@ class TestSprintfComb < Test::Unit::TestCase
def test_format_integer
combination(
- %w[b d o X x],
+ %w[B b d o X x],
[nil, 0, 5, 20],
["", ".", ".0", ".8", ".20"],
['', ' '],