summaryrefslogtreecommitdiff
path: root/test/ruby/test_argf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-14 03:05:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-14 03:05:29 +0000
commitf2dd4eb3cc32b5edd4f6cbff34b922f662300ea5 (patch)
tree7c2fb6a634767ca478f936bc7406129e65fae1d2 /test/ruby/test_argf.rb
parent261903223a967079521c68dda54fe722de98cbf5 (diff)
* io.c (argf_readlines): forward to current_file for arguments
check. http://twitter.com/nagachika/status/3634254856589312 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_argf.rb')
-rw-r--r--test/ruby/test_argf.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb
index ffd5096789e..992c37b261b 100644
--- a/test/ruby/test_argf.rb
+++ b/test/ruby/test_argf.rb
@@ -694,4 +694,22 @@ class TestArgf < Test::Unit::TestCase
assert_equal([@t1.path, @t2.path, @t3.path].inspect, f.gets.chomp)
end
end
+
+ def test_readlines_limit_0
+ bug4024 = '[ruby-dev:42538]'
+ t = make_tempfile
+ argf = ARGF.class.new(t.path)
+ assert_raise(ArgumentError, bug4024) do
+ argf.readlines(0)
+ end
+ end
+
+ def test_each_line_limit_0
+ bug4024 = '[ruby-dev:42538]'
+ t = make_tempfile
+ argf = ARGF.class.new(t.path)
+ assert_raise(ArgumentError, bug4024) do
+ argf.each_line(0).next
+ end
+ end
end