diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2021-02-28 14:01:55 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2021-02-28 14:01:55 +0000 |
commit | aa3dda8bcef6d053c07c1b60f61857f5b5e23b7c (patch) | |
tree | a41af54eab6bbeded48498eb09f7fe9e5756b615 /test | |
parent | 5c74f95fe27c646d3c38e84b6fe949fe9dc4fae4 (diff) |
merge revision(s) f72dc407: [Backport #16297]
Prohibit calling undefined allocator [Bug #16297]
---
object.c | 31 +++++++++++++++++++++++++++++--
test/ruby/test_class.rb | 8 ++++++++
2 files changed, 37 insertions(+), 2 deletions(-)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_class.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index ad2caeb8be..7903a7c178 100644 --- a/test/ruby/test_class.rb +++ b/test/ruby/test_class.rb @@ -232,6 +232,11 @@ class TestClass < Test::Unit::TestCase assert_raise(TypeError) { Class.allocate.superclass } bug6863 = '[ruby-core:47148]' assert_raise(TypeError, bug6863) { Class.new(Class.allocate) } + + allocator = Class.instance_method(:allocate) + assert_raise_with_message(TypeError, /prohibited/) { + allocator.bind(Rational).call + } end def test_nonascii_name |