summaryrefslogtreecommitdiff
path: root/test/stringio
diff options
context:
space:
mode:
authorsorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-09 13:01:23 +0000
committersorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-09 13:01:23 +0000
commit0a69f2e39de67d3d9887673b5030adcc5f2d0b81 (patch)
tree97d3eedd4703e3db789ed9570fdd7cea31606337 /test/stringio
parent699c3de19016690c3901641ca3d0d40822558f05 (diff)
* 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
Diffstat (limited to 'test/stringio')
-rw-r--r--test/stringio/test_stringio.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index c581681..8bf6c59 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -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