From dcb7cc1a8b76b1691b59192474cb7f193acd75cd Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 20 Aug 2011 01:43:26 +0000 Subject: * ext/stringio/stringio.c (strio_read): return new string if nil is explicitly given as a buffer ([Bug #5207]), otherwise set the encoding. also removed dead code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/stringio/test_stringio.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb index 0258218755..26fcc624e2 100644 --- a/test/stringio/test_stringio.rb +++ b/test/stringio/test_stringio.rb @@ -418,6 +418,14 @@ class TestStringIO < Test::Unit::TestCase assert_equal("\u3042\u3044", f.read) f.rewind assert_equal("\u3042\u3044".force_encoding(Encoding::ASCII_8BIT), f.read(f.size)) + + bug5207 = '[ruby-core:39026]' + f.rewind + assert_equal("\u3042\u3044", f.read(nil, nil), bug5207) + f.rewind + s = "" + f.read(nil, s) + assert_equal("\u3042\u3044", s, bug5207) end def test_readpartial -- cgit v1.2.3