diff options
| author | Étienne Barrié <etienne.barrie@gmail.com> | 2025-12-11 16:46:14 +0100 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2025-12-12 20:27:37 +0100 |
| commit | 5903ed7ba9ca60546aa0dd97e92b3d381b7918d3 (patch) | |
| tree | c30199c1e937d402f22f1bdd071a022c36e9b4ee /test/ruby | |
| parent | 7909ce2a839ba1c3e134239189e6aa2de3b6b630 (diff) | |
Prevent ifunc procs from being made shareable
[Bug #21775]
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_ractor.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_ractor.rb b/test/ruby/test_ractor.rb index 09c470911a..6ae511217a 100644 --- a/test/ruby/test_ractor.rb +++ b/test/ruby/test_ractor.rb @@ -201,6 +201,18 @@ class TestRactor < Test::Unit::TestCase RUBY end + def test_symbol_proc_is_shareable + pr = :symbol.to_proc + assert_make_shareable(pr) + end + + # [Bug #21775] + def test_ifunc_proc_not_shareable + h = Hash.new { self } + pr = h.to_proc + assert_unshareable(pr, /not supported yet/, exception: RuntimeError) + end + def assert_make_shareable(obj) refute Ractor.shareable?(obj), "object was already shareable" Ractor.make_shareable(obj) |
