summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2021-02-18 17:59:40 +0900
committerKoichi Sasada <ko1@atdot.net>2021-02-18 22:35:34 +0900
commit7b9476fbfab738d1eb01b4b4c4af9a1680513019 (patch)
treea4095677eb0b686528a7752b7aabba88f3bd27bb /bootstraptest
parent9a5da2dcff51dfd845246cc21645369d1f7201c8 (diff)
Ractor.allocate should not be allowed
Ractor.allocate and Ractor#dup should not be allowed like Thread. [Bug #17642]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4198
Diffstat (limited to 'bootstraptest')
-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 f1c3197275..69f3337764 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