diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-22 04:13:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-22 04:13:52 +0000 |
commit | 66e41cbe4f5dc0c8f499e74bd4553b15ebf1f20b (patch) | |
tree | 68bab1cda1395def5c135194b52824d10b5985a3 /test/ruby/test_argf.rb | |
parent | 23419d859a8b77adc1efa78397b70214eae7428d (diff) | |
download | ruby-66e41cbe4f5dc0c8f499e74bd4553b15ebf1f20b.tar.gz |
io.c: check ARGV element type
* io.c (argf_next_argv): check ARGV element type, and try
conversion if necessary. [ruby-core:71140] [Bug #11610]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_argf.rb')
-rw-r--r-- | test/ruby/test_argf.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb index a9ba9f64e2..cb27b9c64e 100644 --- a/test/ruby/test_argf.rb +++ b/test/ruby/test_argf.rb @@ -899,4 +899,12 @@ class TestArgf < Test::Unit::TestCase assert_equal "done with eof\n", f.gets end end + + def test_wrong_type + assert_separately([], <<-'end;') + bug11610 = '[ruby-core:71140] [Bug #11610]' + ARGV[0] = nil + assert_raise(TypeError, bug11610) {gets} + end; + end end |