summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-01-06 09:14:30 -0500
committerPeter Zhu <peter@peterzhu.ca>2023-01-09 08:49:29 -0500
commit2ad081f79964b2312b6e45c8c98196f300f61937 (patch)
treeaf9dc333ab80e169ad691eca622ab607915657f7 /test/ruby
parent682b45d489b29b297e8b3b2c1ba8f549ed50b77a (diff)
Assert that resizing arrays will re-embed them
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7071
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_gc_compact.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb
index e11b34707f..72d79be037 100644
--- a/test/ruby/test_gc_compact.rb
+++ b/test/ruby/test_gc_compact.rb
@@ -311,7 +311,7 @@ class TestGCCompact < Test::Unit::TestCase
def test_moving_arrays_down_size_pools
omit if GC::INTERNAL_CONSTANTS[:SIZE_POOL_COUNT] == 1
- assert_separately([], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10, signal: :SEGV)
+ assert_separately(%w[-robjspace], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10, signal: :SEGV)
begin;
ARY_COUNT = 500
@@ -324,14 +324,14 @@ 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(arys) # warning: assigned but unused variable - arys
+ assert_include(ObjectSpace.dump(arys[0]), '"embedded":true')
end;
end
def test_moving_arrays_up_size_pools
omit if GC::INTERNAL_CONSTANTS[:SIZE_POOL_COUNT] == 1
- assert_separately([], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10, signal: :SEGV)
+ assert_separately(%w[-robjspace], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10, signal: :SEGV)
begin;
ARY_COUNT = 500
@@ -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(arys) # warning: assigned but unused variable - arys
+ assert_include(ObjectSpace.dump(arys[0]), '"embedded":true')
end;
end