summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-11-30 16:07:36 +0900
committerGitHub <noreply@github.com>2020-11-30 16:07:36 +0900
commit930a135524382ddd80c0608a7593b6cdfceee846 (patch)
tree657d033875f462a3b8b9571a30d9657e08ae08b9 /bootstraptest
parent555bd83a8e8b1e859f698089cbbd9ad938159a0e (diff)
Fixed Ractor.shareable? on cross-recursive objects [Bug #17344]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3823 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_ractor.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb
index d5d78d7ad9..6bd00d546f 100644
--- a/bootstraptest/test_ractor.rb
+++ b/bootstraptest/test_ractor.rb
@@ -975,6 +975,15 @@ assert_equal 'true', %q{
Ractor.shareable?(pr)
}
+# Ractor.shareable?(recursive_objects)
+assert_equal '[false, false]', %q{
+ y = []
+ x = [y, {}].freeze
+ y << x
+ y.freeze
+ [Ractor.shareable?(x), Ractor.shareable?(y)]
+}
+
# define_method() can invoke different Ractor's proc if the proc is shareable.
assert_equal '1', %q{
class C