summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-04-06 13:35:25 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-04-06 13:35:25 -0400
commitbffadcd6d46ccfccade79ce0efb60ced8eac4483 (patch)
tree07ec057544eca87ab44ebd36ca00e80008e4cd6f /test
parentbccec7fb468ad977be75e7e4c2644b4ea845ab0c (diff)
downloadruby-bffadcd6d46ccfccade79ce0efb60ced8eac4483.tar.gz
Add guard to compaction test in WeakMap
Some platforms don't support compaction, so we should skip this test.
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_weakmap.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_weakmap.rb b/test/ruby/test_weakmap.rb
index c72e7310db..7fc956dfae 100644
--- a/test/ruby/test_weakmap.rb
+++ b/test/ruby/test_weakmap.rb
@@ -178,6 +178,8 @@ class TestWeakMap < Test::Unit::TestCase
end
def test_compaction_bug_19529
+ omit "compaction is not supported on this platform" unless GC.respond_to?(:compact)
+
obj = Object.new
100.times do |i|
GC.compact