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

* 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
This commit is contained in:
nobu 2011-08-20 01:43:26 +00:00
parent e9930a4b56
commit dcb7cc1a8b
3 changed files with 26 additions and 10 deletions

View file

@ -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