diff options
author | Peter Zhu <peter@peterzhu.ca> | 2021-02-23 16:36:04 -0500 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2021-02-25 11:01:50 -0800 |
commit | a9920e7782f225b97e173a88640fe9e116b9964f (patch) | |
tree | 5dedac5892bb3044a5e93cf838daed0f19020d2e /test | |
parent | 1c0e79e87b202ac707833fb1bd5e9398c8d0b4fb (diff) |
Add tests for bug 17652
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4227
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_gc_compact.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb index 4a8cff33f4..c4277d1ffe 100644 --- a/test/ruby/test_gc_compact.rb +++ b/test/ruby/test_gc_compact.rb @@ -60,6 +60,22 @@ class TestGCCompact < Test::Unit::TestCase GC.auto_compact = before end + def test_bug_17652 + assert_in_out_err([], "#{<<~"{#"}#{<<~'};'}", timeout: 60) + {# + GC.auto_compact = true + + times = 20_000_000 + arr = Array.new(times) + times.times do |i| + arr[i] = "#{i}" + end + + arr = Array.new(1_000_000, 42) + GC.start + }; + end + private def supports_auto_compact? |