From 77e9edc3348f33904424ceaa14e9692b8b91d7f3 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 3 Dec 2015 06:33:13 +0000 Subject: 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 --- test/ruby/test_sprintf.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3