ruby/bootstraptest/test_finalizer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 строки
395 B
Ruby
Исходник Обычный вид История

assert_normal_exit %q{
a1,a2,b1,b2=Array.new(4){""}
ObjectSpace.define_finalizer(b2,proc{})
ObjectSpace.define_finalizer(b1,proc{b1.inspect})
ObjectSpace.define_finalizer(a2,proc{a1.inspect})
ObjectSpace.define_finalizer(a1,proc{})
}, '[ruby-dev:35778]'
2024-03-28 22:30:25 +03:00
assert_equal 'true', %q{
obj = Object.new
id = obj.object_id
ObjectSpace.define_finalizer(obj, proc { |i| print(id == i) })
nil
}