diff options
| -rw-r--r-- | bootstraptest/test_ractor.rb | 21 |
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 } |
