1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

add test for %B.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-10-14 14:08:36 +00:00
parent 80cdf946f7
commit 4dbc8e2454

View file

@ -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"],
['', ' '],