mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/stringio/stringio.c (strio_getline): check whether str is
a string when str and lim are given. https://twitter.com/watson1978/status/56225052152168449 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4ca9e7d03a
commit
653b4248a3
3 changed files with 22 additions and 12 deletions
|
@ -51,6 +51,8 @@ class TestStringIO < Test::Unit::TestCase
|
|||
assert_equal("abc\n", StringIO.new("abc\n\ndef\n").gets)
|
||||
assert_equal("abc\n\ndef\n", StringIO.new("abc\n\ndef\n").gets(nil))
|
||||
assert_equal("abc\n\n", StringIO.new("abc\n\ndef\n").gets(""))
|
||||
assert_raise(TypeError){StringIO.new("").gets(1, 1)}
|
||||
assert_raise(TypeError){StringIO.new("").gets(nil, nil)}
|
||||
end
|
||||
|
||||
def test_readlines
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue