summaryrefslogtreecommitdiff
path: root/test/ruby/test_sprintf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-03 06:33:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-03 06:33:13 +0000
commit77e9edc3348f33904424ceaa14e9692b8b91d7f3 (patch)
tree4cc7a6af54afd5f8a38a1bdead524f160dd69e8b /test/ruby/test_sprintf.rb
parentf7fb4e00f721a9d0520b0bbeab687d122f6759ff (diff)
sprintf.c: fix garbage inserted with Rational
* sprintf.c (rb_str_format): fix wrong shifting position in Rational conversion when not at the beginning of the result. [ruby-core:71806] [Bug #11766] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_sprintf.rb')
-rw-r--r--test/ruby/test_sprintf.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb
index 8af94a89fe..f400e2be6e 100644
--- a/test/ruby/test_sprintf.rb
+++ b/test/ruby/test_sprintf.rb
@@ -166,6 +166,9 @@ class TestSprintf < Test::Unit::TestCase
end
end
end
+
+ bug11766 = '[ruby-core:71806] [Bug #11766]'
+ assert_equal("x"*10+" 1.0", sprintf("x"*10+"%8.1f", 1r))
end
def test_hash