summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_io.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index af7f428ec4..73a16de4cc 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1702,4 +1702,24 @@ End
GC.start
end
end
+
+ def test_readlines_limit_0
+ bug4024 = '[ruby-dev:42538]'
+ t = make_tempfile
+ open(t.path, "r") do |io|
+ assert_raise(ArgumentError, bug4024) do
+ io.readlines(0)
+ end
+ end
+ end
+
+ def test_each_line_limit_0
+ bug4024 = '[ruby-dev:42538]'
+ t = make_tempfile
+ open(t.path, "r") do |io|
+ assert_raise(ArgumentError, bug4024) do
+ io.each_line(0).next
+ end
+ end
+ end
end