8000 Add test for compaction · jhawthorn/vernier@702b139 · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
Add test for compaction
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Oct 31, 2024
1 parent 1c542dc commit 702b139
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/test_retained_memory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,24 @@ def test_alloc_order
assert_equal expected_inspects, inspects.grep(/#alloc_[abc]/)
end

def test_compaction
retained = []

result = Vernier.trace_retained do
100.times {
Object.new
retained << Object.new
}
GC.verify_compaction_references(toward: :empty, expand_heap: true)
100.times {
Object.new
retained << Object.new
}
end

assert_operator result.samples.size, :>, 200
end

def test_nothing_retained_in_module_eval
skip("WIP")

Expand Down

0 comments on commit 702b139

Please sign in to comment.
0