diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/objspace/test_ractor.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/objspace/test_ractor.rb b/test/objspace/test_ractor.rb index 4901eeae2e..c5bb656da6 100644 --- a/test/objspace/test_ractor.rb +++ b/test/objspace/test_ractor.rb @@ -14,4 +14,23 @@ class TestObjSpaceRactor < Test::Unit::TestCase end RUBY end + + def test_undefine_finalizer + assert_ractor(<<~'RUBY', require: 'objspace') + def fin + ->(id) { } + end + ractors = 5.times.map do + Ractor.new do + 10_000.times do + o = Object.new + ObjectSpace.define_finalizer(o, fin) + ObjectSpace.undefine_finalizer(o) + end + end + end + + ractors.each(&:take) + RUBY + end end |
