diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2024-05-29 10:19:49 -0700 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2024-05-29 10:19:49 -0700 |
| commit | f12c947192aa47b355015384e5c82cbf674023f1 (patch) | |
| tree | a45c0fdbc4318c53a15e7a69779bafea9dba0e04 /test/ruby | |
| parent | a8b2317d16fa172edd3cd7e6fcb3bc694287d109 (diff) | |
merge revision(s) e04146129ec6898dd6a9739dad2983c6e9b68056: [Backport #20292]
[Bug #20292] Truncate embedded string to new capacity
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_string.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 42f2544b5a..85a72b09cc 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -80,6 +80,13 @@ class TestString < Test::Unit::TestCase assert_equal("mystring", str.__send__(:initialize, "mystring", capacity: 1000)) str = S("mystring") assert_equal("mystring", str.__send__(:initialize, str, capacity: 1000)) + + if @cls == String + 100.times { + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa". + __send__(:initialize, capacity: -1) + } + end end def test_initialize_shared |
