diff options
Diffstat (limited to 'bootstraptest/test_ractor.rb')
-rw-r--r-- | bootstraptest/test_ractor.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb index a853e91416..06bd739931 100644 --- a/bootstraptest/test_ractor.rb +++ b/bootstraptest/test_ractor.rb @@ -1245,6 +1245,20 @@ assert_equal '[:ok, :ok]', %q{ end } +# Ractor-local storage +assert_equal '[nil, "b", "a"]', %q{ + ans = [] + Ractor.current[:key] = 'a' + r = Ractor.new{ + Ractor.yield self[:key] + self[:key] = 'b' + self[:key] + } + ans << r.take + ans << r.take + ans << Ractor.current[:key] +} + ### ### Synchronization tests ### |