summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_ractor.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_ractor.rb b/test/ruby/test_ractor.rb
index 5275768113..ec94df361f 100644
--- a/test/ruby/test_ractor.rb
+++ b/test/ruby/test_ractor.rb
@@ -60,6 +60,17 @@ class TestRactor < Test::Unit::TestCase
assert_unshareable(x, "can not make shareable object for #<Method: String(Kernel)#itself()>", exception: Ractor::Error)
end
+ def test_default_thread_group
+ assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
+ begin;
+ Warning[:experimental] = false
+
+ main_ractor_id = Thread.current.group.object_id
+ ractor_id = Ractor.new { Thread.current.group.object_id }.take
+ refute_equal main_ractor_id, ractor_id
+ end;
+ end
+
def assert_make_shareable(obj)
refute Ractor.shareable?(obj), "object was already shareable"
Ractor.make_shareable(obj)