Add guard to compaction test in WeakMap

Some platforms don't support compaction, so we should skip this test.
This commit is contained in:
Peter Zhu 2023-04-06 13:35:25 -04:00
Родитель bccec7fb46
Коммит bffadcd6d4
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -178,6 +178,8 @@ class TestWeakMap < Test::Unit::TestCase
end end
def test_compaction_bug_19529 def test_compaction_bug_19529
omit "compaction is not supported on this platform" unless GC.respond_to?(:compact)
obj = Object.new obj = Object.new
100.times do |i| 100.times do |i|
GC.compact GC.compact