summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2025-11-01 11:38:16 +0100
committerBenoit Daloze <eregontp@gmail.com>2025-11-01 12:16:04 +0100
commit33a026fedd43fa5472937e77834397742fed6180 (patch)
tree5a639cb4c757939b4150629b43ae23387399f656
parentbabf50e33bb0d9e1f3c37d11c1cfdc50c4f5bc7e (diff)
Fix the description and logic for the Ractor.make_shareable(Proc) test
-rw-r--r--bootstraptest/test_ractor.rb21
1 files changed, 12 insertions, 9 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb
index fef55ffd68..a437faeac1 100644
--- a/bootstraptest/test_ractor.rb
+++ b/bootstraptest/test_ractor.rb
@@ -1187,16 +1187,19 @@ assert_equal 'true', %q{
[a.frozen?, a[0].frozen?] == [true, false]
}
-# Ractor.make_shareable(a_proc) is not supported now.
-assert_equal 'true', %q{
- pr = Proc.new{}
+# Ractor.make_shareable(a_proc) requires a shareable receiver
+assert_equal '[:ok, :error]', %q{
+ pr1 = nil.instance_exec { Proc.new{} }
+ pr2 = Proc.new{}
- begin
- Ractor.make_shareable(pr)
- rescue Ractor::Error
- true
- else
- false
+ [pr1, pr2].map do |pr|
+ begin
+ Ractor.make_shareable(pr)
+ rescue Ractor::Error
+ :error
+ else
+ :ok
+ end
end
}