summaryrefslogtreecommitdiff
path: root/jni/ruby/test/-ext-/string/test_modify_expand.rb
diff options
context:
space:
mode:
authorJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-16 18:49:26 +0900
committerJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-30 00:39:06 +0900
commitfcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch)
tree64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/test/-ext-/string/test_modify_expand.rb
Fresh start
Diffstat (limited to 'jni/ruby/test/-ext-/string/test_modify_expand.rb')
-rw-r--r--jni/ruby/test/-ext-/string/test_modify_expand.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/jni/ruby/test/-ext-/string/test_modify_expand.rb b/jni/ruby/test/-ext-/string/test_modify_expand.rb
new file mode 100644
index 0000000..34b7be7
--- /dev/null
+++ b/jni/ruby/test/-ext-/string/test_modify_expand.rb
@@ -0,0 +1,15 @@
+require 'test/unit'
+require "-test-/string/string"
+
+class Test_StringModifyExpand < Test::Unit::TestCase
+ def test_modify_expand_memory_leak
+ assert_no_memory_leak(["-r-test-/string/string"],
+ <<-PRE, <<-CMD, "rb_str_modify_expand()", limit: 2.5)
+ s=Bug::String.new
+ PRE
+ size = $initial_size
+ 10.times{s.modify_expand!(size)}
+ s.replace("")
+ CMD
+ end
+end