summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-18 15:10:54 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-18 15:10:54 +0000
commit0181fbc4dee797bd704f1ae2b6827dd3caae64e2 (patch)
tree5d89881afd655c8beb6bb554678ee072d32a1faf /test
parent557ba3fee5b60025cf90aee58d3b4be5ebf53852 (diff)
merge revision(s) 52211: [Backport #11610] [Backport #11637]
* 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/branches/ruby_2_2@52650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_argf.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb
index 6975b83a28..10da4abeba 100644
--- a/test/ruby/test_argf.rb
+++ b/test/ruby/test_argf.rb
@@ -856,4 +856,12 @@ class TestArgf < Test::Unit::TestCase
assert_equal([49, 10, 50, 10, 51, 10, 52, 10, 53, 10, 54, 10], Marshal.load(f.read))
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