diff options
author | Peter Zhu <peter@peterzhu.ca> | 2021-11-08 15:15:38 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2021-11-08 15:39:53 -0500 |
commit | 39d3d24abbd63a109ebf70c229e3a6cab927fc90 (patch) | |
tree | aa4d746226f2990b84fda2b61350e2795115b863 /test/ruby/test_sprintf.rb | |
parent | 309406484b98fe0aea55016d8f5971b4e6b91761 (diff) |
[Feature #18290] Remove tests that test use of rb_gc_force_recycle
Remove tests that assume objects get force recycled.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5096
Diffstat (limited to 'test/ruby/test_sprintf.rb')
-rw-r--r-- | test/ruby/test_sprintf.rb | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/test/ruby/test_sprintf.rb b/test/ruby/test_sprintf.rb index 7986e9d141..f2e73eb58d 100644 --- a/test/ruby/test_sprintf.rb +++ b/test/ruby/test_sprintf.rb @@ -528,19 +528,4 @@ class TestSprintf < Test::Unit::TestCase sprintf("%*s", RbConfig::LIMITS["INT_MIN"], "") end end - - def test_no_hidden_garbage - skip unless Thread.list.size == 1 - - fmt = [4, 2, 2].map { |x| "%0#{x}d" }.join('-') # defeats optimization - ObjectSpace.count_objects(res = {}) # creates strings on first call - GC.disable - before = ObjectSpace.count_objects(res)[:T_STRING] - val = sprintf(fmt, 1970, 1, 1) - after = ObjectSpace.count_objects(res)[:T_STRING] - assert_equal before + 1, after, 'only new string is the created one' - assert_equal '1970-01-01', val - ensure - GC.enable - end end |