summaryrefslogtreecommitdiff
path: root/bootstraptest/test_ractor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bootstraptest/test_ractor.rb')
-rw-r--r--bootstraptest/test_ractor.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb
index ab20082711..4b6afc2c53 100644
--- a/bootstraptest/test_ractor.rb
+++ b/bootstraptest/test_ractor.rb
@@ -17,6 +17,27 @@ assert_equal "must be called with a block", %q{
end
}
+# Ractor#inspect
+assert_equal "#<Ractor:#1 running>", %q{
+ Ractor.current.inspect
+}
+
+assert_match /^#<Ractor:#([^ ]*?) bootstraptest.tmp.rb:[0-9]+ blocking>$/, %q{
+ r = Ractor.new { Ractor.recv }
+ r.inspect
+}
+
+assert_match /^#<Ractor:#([^ ]*?) bootstraptest.tmp.rb:[0-9]+ terminated>$/, %q{
+ r = Ractor.new { '' }
+ r.take
+ r.inspect
+}
+
+assert_match /^#<Ractor:#([^ ]*?) Test Ractor bootstraptest.tmp.rb:[0-9]+ blocking>$/, %q{
+ r = Ractor.new(name: 'Test Ractor') { Ractor.recv }
+ r.inspect
+}
+
# A return value of a Ractor block will be a message from the Ractor.
assert_equal 'ok', %q{
# join