summaryrefslogtreecommitdiff
path: root/bootstraptest/test_ractor.rb
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2021-03-12 00:32:56 +0900
committerNARUSE, Yui <naruse@airemix.jp>2021-03-12 00:32:56 +0900
commit72c6497453f74f3398130d99fc610922f3995ae5 (patch)
treefc3cf0a62c26444d74175b4a3e8a389d04ed3642 /bootstraptest/test_ractor.rb
parent6305d1c6edeec2c3aa25b9220142274f1ef2e868 (diff)
merge revision(s) 7b9476fbfab738d1eb01b4b4c4af9a1680513019: [Backport #17642]
Ractor.allocate should not be allowed Ractor.allocate and Ractor#dup should not be allowed like Thread. [Bug #17642] --- bootstraptest/test_ractor.rb | 18 ++++++++++++++++++ ractor.c | 2 ++ 2 files changed, 20 insertions(+)
Diffstat (limited to 'bootstraptest/test_ractor.rb')
-rw-r--r--bootstraptest/test_ractor.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb
index 1c29a2b799..878b846487 100644
--- a/bootstraptest/test_ractor.rb
+++ b/bootstraptest/test_ractor.rb
@@ -8,6 +8,24 @@ assert_equal 'Ractor', %q{
Ractor.new{}.class
}
+# Ractor.allocate is not supported
+assert_equal "[:ok, :ok]", %q{
+ rs = []
+ begin
+ Ractor.allocate
+ rescue => e
+ rs << :ok if e.message == 'allocator undefined for Ractor'
+ end
+
+ begin
+ Ractor.new{}.dup
+ rescue
+ rs << :ok if e.message == 'allocator undefined for Ractor'
+ end
+
+ rs
+}
+
# A Ractor can have a name
assert_equal 'test-name', %q{
r = Ractor.new name: 'test-name' do