summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-12-01 16:34:59 +0900
committerKoichi Sasada <ko1@atdot.net>2020-12-01 18:16:23 +0900
commit764de7566ffa3fe828abf13ec93d76515ba27dd1 (patch)
tree3611b0c03eedc8fad41a7783860cdb04e9c67355 /bootstraptest
parentd5e16161f6871793bf2f148b5a6901a1a3f6d326 (diff)
should not use rb_str_modify(), too
Same as 8247b8edde, should not use rb_str_modify() here. https://bugs.ruby-lang.org/issues/17343#change-88858
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3833
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_ractor.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb
index 2ae6602c82..a960d9d00f 100644
--- a/bootstraptest/test_ractor.rb
+++ b/bootstraptest/test_ractor.rb
@@ -1022,13 +1022,21 @@ assert_equal 'can not make a Proc shareable because it accesses outer variables
end
}
-# Ractor deep copies frozen objects
+# Ractor deep copies frozen objects (ary)
assert_equal '[true, false]', %q{
Ractor.new([[]].freeze) { |ary|
[ary.frozen?, ary.first.frozen? ]
}.take
}
+# Ractor deep copies frozen objects (str)
+assert_equal '[true, false]', %q{
+ s = String.new.instance_eval { @x = []; freeze}
+ Ractor.new(s) { |s|
+ [s.frozen?, s.instance_variable_get(:@x).frozen?]
+ }.take
+}
+
###
### Synchronization tests
###