Skip to content

Commit 33a026f

Browse files
committed
Fix the description and logic for the Ractor.make_shareable(Proc) test
1 parent babf50e commit 33a026f

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

bootstraptest/test_ractor.rb

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,16 +1187,19 @@ def /(other)
11871187
[a.frozen?, a[0].frozen?] == [true, false]
11881188
}
11891189

1190-
# Ractor.make_shareable(a_proc) is not supported now.
1191-
assert_equal 'true', %q{
1192-
pr = Proc.new{}
1190+
# Ractor.make_shareable(a_proc) requires a shareable receiver
1191+
assert_equal '[:ok, :error]', %q{
1192+
pr1 = nil.instance_exec { Proc.new{} }
1193+
pr2 = Proc.new{}
11931194
1194-
begin
1195-
Ractor.make_shareable(pr)
1196-
rescue Ractor::Error
1197-
true
1198-
else
1199-
false
1195+
[pr1, pr2].map do |pr|
1196+
begin
1197+
Ractor.make_shareable(pr)
1198+
rescue Ractor::Error
1199+
:error
1200+
else
1201+
:ok
1202+
end
12001203
end
12011204
}
12021205

0 commit comments

Comments
 (0)