summaryrefslogtreecommitdiff
path: root/test/ruby/test_gc_compact.rb
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-07-31 10:26:43 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-07-31 11:46:53 -0400
commit547d2378acca6ee376a9f1b0a619c919e834b3cb (patch)
tree7380ecaf1309c848e9845462e7589475e42113e9 /test/ruby/test_gc_compact.rb
parentb98838b65cbf8fa2d228f9e0249414cba4e3197d (diff)
Assert that at least one element has been embedded
It's not guaranteed that the first element will always be embedded.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8116
Diffstat (limited to 'test/ruby/test_gc_compact.rb')
-rw-r--r--test/ruby/test_gc_compact.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb
index 44da6aabee..5cdd06ffcf 100644
--- a/test/ruby/test_gc_compact.rb
+++ b/test/ruby/test_gc_compact.rb
@@ -324,7 +324,7 @@ class TestGCCompact < Test::Unit::TestCase
stats = GC.verify_compaction_references(expand_heap: true, toward: :empty)
assert_operator(stats.dig(:moved_down, :T_ARRAY) || 0, :>=, ARY_COUNT)
- assert_include(ObjectSpace.dump(arys[0]), '"embedded":true')
+ refute_empty(arys.keep_if { |o| ObjectSpace.dump(o).include?('"embedded":true') })
end;
end
@@ -346,7 +346,7 @@ class TestGCCompact < Test::Unit::TestCase
stats = GC.verify_compaction_references(expand_heap: true, toward: :empty)
assert_operator(stats.dig(:moved_up, :T_ARRAY) || 0, :>=, ARY_COUNT)
- assert_include(ObjectSpace.dump(arys[0]), '"embedded":true')
+ refute_empty(arys.keep_if { |o| ObjectSpace.dump(o).include?('"embedded":true') })
end;
end
@@ -376,7 +376,7 @@ class TestGCCompact < Test::Unit::TestCase
stats = GC.verify_compaction_references(expand_heap: true, toward: :empty)
assert_operator(stats.dig(:moved_up, :T_OBJECT) || 0, :>=, OBJ_COUNT)
- assert_include(ObjectSpace.dump(ary[0]), '"embedded":true')
+ refute_empty(ary.keep_if { |o| ObjectSpace.dump(o).include?('"embedded":true') })
end;
end
@@ -395,7 +395,7 @@ class TestGCCompact < Test::Unit::TestCase
stats = GC.verify_compaction_references(expand_heap: true, toward: :empty)
assert_operator(stats[:moved_up][:T_STRING], :>=, STR_COUNT)
- assert_include(ObjectSpace.dump(ary[0]), '"embedded":true')
+ refute_empty(ary.keep_if { |o| ObjectSpace.dump(o).include?('"embedded":true') })
end;
end
@@ -413,7 +413,7 @@ class TestGCCompact < Test::Unit::TestCase
stats = GC.verify_compaction_references(expand_heap: true, toward: :empty)
assert_operator(stats[:moved_down][:T_STRING], :>=, STR_COUNT)
- assert_include(ObjectSpace.dump(ary[0]), '"embedded":true')
+ refute_empty(ary.keep_if { |o| ObjectSpace.dump(o).include?('"embedded":true') })
end;
end