summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-20 08:39:12 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-20 08:39:12 +0000
commit79881c94c2e66b1d3e98c5defb7919ba9e77d187 (patch)
treeb037bfd9f3815e6b167f5a9a95366eec903c142c /test/ruby
parent0cddf1b4331877019f65bf3ba572f7f8d0371115 (diff)
merge revision(s) 50541,50542: [Backport #11159]
* iseq.c (rb_iseq_compile_with_option): check srouce type, must be an IO or a String. [ruby-core:69219] [Bug #11159] * iseq.c (rb_iseq_compile_with_option): check source type, must be git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_iseq.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index 4e3f6c1926..5fe90b0ebf 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -124,4 +124,11 @@ class TestISeq < Test::Unit::TestCase
ISeq.of(c.instance_method(:foobar)).label
assert_same a, b
end
+
+ def test_invalid_source
+ bug11159 = '[ruby-core:69219] [Bug #11159]'
+ assert_raise(TypeError, bug11159) {ISeq.compile(nil)}
+ assert_raise(TypeError, bug11159) {ISeq.compile(:foo)}
+ assert_raise(TypeError, bug11159) {ISeq.compile(1)}
+ end
end