summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-12-22 02:22:51 +0900
committerKoichi Sasada <ko1@atdot.net>2020-12-22 05:54:14 +0900
commitd0e4ccbefcdd6032d0ae70bc54c9a4fb55d92576 (patch)
treee3f9a1c74ab923e831e8049352d984d0ceb4719a /bootstraptest
parent35471a948739ca13b85fe900871e081d553f68e6 (diff)
add Ractor.main
It returns main Ractor, like Thread.main. [Feature #17418]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3963
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_ractor.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb
index 06bd739931..843714a7bc 100644
--- a/bootstraptest/test_ractor.rb
+++ b/bootstraptest/test_ractor.rb
@@ -396,6 +396,13 @@ assert_equal 'ok', %q{
end
}
+# Ractor.main returns main ractor
+assert_equal 'true', %q{
+ Ractor.new{
+ Ractor.main
+ }.take == Ractor.current
+}
+
# a ractor with closed outgoing port should terminate
assert_equal 'ok', %q{
Ractor.new do