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 | 9c8fc97c0a8f4ad77b868aeda9376f9cdaaa09e4 (patch) | |
tree | 68bab1cda1395def5c135194b52824d10b5985a3 /test/ruby | |
parent | 7d6407b64a828cfbfcbea8ce68d2379fa9d12bcf (diff) | |
download | ruby-9c8fc97c0a8f4ad77b868aeda9376f9cdaaa09e4.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')
-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 |