2015-12-16 05:07:31 +00:00
|
|
|
# frozen_string_literal: false
|
2012-02-08 13:35:27 +00:00
|
|
|
require 'test/unit'
|
2015-07-15 03:56:17 +00:00
|
|
|
require "-test-/string"
|
2012-02-08 13:35:27 +00:00
|
|
|
|
|
|
|
class Test_StringModifyExpand < Test::Unit::TestCase
|
|
|
|
def test_modify_expand_memory_leak
|
2015-07-15 03:56:17 +00:00
|
|
|
assert_no_memory_leak(["-r-test-/string"],
|
2014-09-17 22:05:22 +00:00
|
|
|
<<-PRE, <<-CMD, "rb_str_modify_expand()", limit: 2.5)
|
2012-02-08 13:35:27 +00:00
|
|
|
s=Bug::String.new
|
2012-02-09 15:47:11 +00:00
|
|
|
PRE
|
|
|
|
size = $initial_size
|
2012-02-08 13:35:27 +00:00
|
|
|
10.times{s.modify_expand!(size)}
|
|
|
|
s.replace("")
|
|
|
|
CMD
|
|
|
|
end
|
|
|
|
end
|