test/-ext-/vm/test_at_exit.rb
raw| 1 | # frozen_string_literal: false |
| 2 | class TestVM < Test::Unit::TestCase |
| 3 | |
| 4 | # [Bug #12095] |
| 5 | def test_at_exit |
| 6 | |
| 7 | assert_in_out_err([], <<-"end;", %w[begin end]) # do |
| 8 | require '-test-/vm/at_exit' |
| 9 | Bug::VM.register_at_exit(false) |
| 10 | 1000.times do |
| 11 | Bug::VM.register_at_exit(nil) |
| 12 | ["x"]*1000 |
| 13 | end |
| 14 | GC.start |
| 15 | Bug::VM.register_at_exit(true) |
| 16 | end; |
| 17 | end |
| 18 | end |
| 19 |