diff options
author | Jemma Issroff <[email protected]> | 2022-10-19 09:30:41 -0400 |
---|---|---|
committer | Aaron Patterson <[email protected]> | 2022-10-19 11:06:19 -0700 |
commit | 0aaa6133ed7365e5037ccdac8b59b00fb13aa50e (patch) | |
tree | c5fbd725f7534b08a32b304beeb9fea954a1b1e7 /test/ruby/test_string.rb | |
parent | 5ca23caa2057fc4760fbefab6087371b11c4bc6c (diff) |
Transition frozen string to frozen root shape
Co-Authored-By: Aaron Patterson <[email protected]>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6590
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index ab14a3c17b..4add7dfe2f 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -887,6 +887,18 @@ CODE end end + class StringWithIVSet < String + def set_iv + @foo = 1 + end + end + + def test_ivar_set_after_frozen_dup + str = StringWithIVSet.new.freeze + str.dup.set_iv + assert_raise(FrozenError) { str.set_iv } + end + def test_each verbose, $VERBOSE = $VERBOSE, nil |