diff options
author | Peter Zhu <[email protected]> | 2023-11-30 14:48:26 -0500 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-12-01 15:04:31 -0500 |
commit | ee0eca191f3ca486b6056234add436a8c1488dba (patch) | |
tree | 495a7253af9ff8782d47b270ebbc5404c57983c5 /test/ruby/test_string.rb | |
parent | 80ea7fbad871b2222b16af1bd9f39e1f1828bbd4 (diff) |
Make String#undump compaction safe
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 2ccabcbe80..42553cba82 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -896,6 +896,17 @@ CODE } end + def test_undump_gc_compact_stress + a = S("Test") << 1 << 2 << 3 << 9 << 13 << 10 + EnvUtil.under_gc_compact_stress do + assert_equal(a, S('"Test\\x01\\x02\\x03\\t\\r\\n"').undump) + end + + EnvUtil.under_gc_compact_stress do + assert_equal(S("\u{ABCDE 10ABCD}"), S('"\\u{ABCDE 10ABCD}"').undump) + end + end + def test_dup for frozen in [ false, true ] a = S("hello") |