diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-17 12:54:26 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-17 12:54:26 +0000 |
commit | 0ff4061ef7e3a8ffa681698fa8490740616d1aac (patch) | |
tree | bc0a4013717fed66329c7ca7ec965812acac0b11 /test/ruby | |
parent | 59491ed3b06481a3991aca84aebb5e55e5a12edd (diff) | |
download | ruby-0ff4061ef7e3a8ffa681698fa8490740616d1aac.tar.gz |
* io.c (prepare_getline_args): io.gets(10,nil) should cause TypeError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_io.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index d4a51cc8dc..0c41847c52 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 |