mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/stringio/stringio.c (strio_each, strio_readlines):
limit must not be zero. Fixes [ruby-dev:43392]. * test/stringio/test_stringio.rb: Add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
699c3de190
commit
0a69f2e39d
3 changed files with 26 additions and 0 deletions
|
@ -482,4 +482,12 @@ class TestStringIO < Test::Unit::TestCase
|
|||
assert_raise(RuntimeError, bug) {s.string = "foo"}
|
||||
assert_raise(RuntimeError, bug) {s.reopen("")}
|
||||
end
|
||||
|
||||
def test_readlines_limit_0
|
||||
assert_raise(ArgumentError, "[ruby-dev:43392]") { StringIO.new.readlines(0) }
|
||||
end
|
||||
|
||||
def test_each_line_limit_0
|
||||
assert_raise(ArgumentError, "[ruby-dev:43392]") { StringIO.new.each_line(0) }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue