[rubygems/rubygems] Use a constant empty tar header to avoid extra allocations
[ruby.git] / test / -ext- / string / test_nofree.rb
blob86681e46523391ea5bf422fce96644fbefb4c0cb
1 # frozen_string_literal: false
2 require 'test/unit'
4 class Test_StringNoFree < Test::Unit::TestCase
5   def test_no_memory_leak
6     bug10942 = '[ruby-core:68436] [Bug #10942] no leak on nofree string'
7     code = '.times {Bug::String.nofree << "a" * 100}'
8     assert_no_memory_leak(%w(-r-test-/string),
9                           "100_000#{code}",
10                           "1_000_000#{code}",
11                           bug10942, rss: true)
12   end
13 end