summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-22 08:26:42 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-23 13:50:42 +0900
commitc0a2d95cf318cf9b9ffe23f0a4b8720f69775448 (patch)
treef46cfc8edc2a68f735523cdaf0540ee9ddafcb74 /test
parentb2aa21b868419c2d87e2812b6b3584a8a1479c23 (diff)
Update rb_ractor_ensure_shareable
* Fixed use of rb_ractor_shareable_p * Raise Ractor::IsolationError
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3950
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_parse.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index 8d12538fa3..aeaa42dadb 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -1178,8 +1178,8 @@ x = __ENCODING__
Class.new.class_eval(code)
end
- def assert_ractor_error(message, code)
- assert_raise_with_message(Ractor::Error, message) do
+ def assert_raise_separately(error, message, code)
+ assert_raise_with_message(error, message) do
eval_separately(code)
end
end
@@ -1243,7 +1243,8 @@ x = __ENCODING__
end
def test_shareable_constant_value_unshareable_literal
- assert_ractor_error(/unshareable/, "#{<<~"begin;"}\n#{<<~'end;'}")
+ assert_raise_separately(Ractor::IsolationError, /unshareable/,
+ "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
# shareable_constant_value: literal
C = ["Not " + "shareable"]
@@ -1264,7 +1265,8 @@ x = __ENCODING__
end
def test_shareable_constant_value_unfrozen
- assert_ractor_error(/does not freeze object correctly/, "#{<<~"begin;"}\n#{<<~'end;'}")
+ assert_raise_separately(Ractor::Error, /does not freeze object correctly/,
+ "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
# shareable_constant_value: experimental_everything
o = Object.new