diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_set.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_set.rb b/test/ruby/test_set.rb index fd3ac4d9b6..5d77c502e0 100644 --- a/test/ruby/test_set.rb +++ b/test/ruby/test_set.rb @@ -864,6 +864,19 @@ class TC_Set < Test::Unit::TestCase assert_equal(klass.new([a]), set, klass.name) } end + + def test_set_gc_compact_does_not_allocate + assert_in_out_err([], <<-"end;", [], []) + def x + s = Set.new + s << Object.new + s + end + + x + GC.compact + end; + end end class TC_Enumerable < Test::Unit::TestCase |
