diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_parse.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index aeaa42dadb..2e3fbc9945 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -1252,16 +1252,18 @@ x = __ENCODING__ end def test_shareable_constant_value_nonliteral - c, d = eval_separately("#{<<~"begin;"}\n#{<<~'end;'}") + assert_raise_separately(Ractor::IsolationError, /unshareable/, "#{<<~"begin;"}\n#{<<~'end;'}") begin; # shareable_constant_value: literal var = [:not_frozen] C = var + end; + + assert_raise_separately(Ractor::IsolationError, /unshareable/, "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + # shareable_constant_value: literal D = begin [] end - [C, D] end; - assert_not_ractor_shareable(c) - assert_not_ractor_shareable(d) end def test_shareable_constant_value_unfrozen |