aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fiber/test_ractor.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/fiber/test_ractor.rb b/test/fiber/test_ractor.rb
new file mode 100644
index 0000000000..6d53b617d9
--- /dev/null
+++ b/test/fiber/test_ractor.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+require "test/unit"
+require "fiber"
+
+class TestFiberCurrentRactor < Test::Unit::TestCase
+ def setup
+ skip unless defined? Ractor
+ end
+
+ def test_ractor_shareable
+ assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
+ begin;
+ require "fiber"
+ r = Ractor.new do
+ Fiber.new do
+ Fiber.current.class
+ end.resume
+ end
+ assert_equal(Fiber, r.take)
+ end;
+ end
+end