summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-17 12:54:26 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-17 12:54:26 +0000
commit1b91d48bf9059d295edb865b9a6ebbb2c397c617 (patch)
treebc0a4013717fed66329c7ca7ec965812acac0b11 /test
parentd95b92a6f9cf64956d2b54039f519ea5124bc649 (diff)
downloadruby-1b91d48bf9059d295edb865b9a6ebbb2c397c617.tar.gz
ruby-1b91d48bf9059d295edb865b9a6ebbb2c397c617.tar.xz
ruby-1b91d48bf9059d295edb865b9a6ebbb2c397c617.zip
* io.c (prepare_getline_args): io.gets(10,nil) should cause TypeError.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index d4a51cc8d..0c41847c5 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -44,6 +44,15 @@ class TestIO < Test::Unit::TestCase
r.close
end
+ def test_gets_limit_extra_arg
+ with_pipe {|r, w|
+ r, w = IO.pipe
+ w << "0123456789"
+ w.close
+ assert_raise(TypeError) { r.gets(3,nil) }
+ }
+ end
+
# This test cause SEGV.
def test_ungetc
r, w = IO.pipe