From 4dbc8e24542e39b627e3546a58aabf59462c9c7d Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 14 Oct 2008 14:08:36 +0000 Subject: [PATCH] add test for %B. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_sprintf_comb.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"], ['', ' '],