summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-22 22:10:11 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-23 13:50:42 +0900
commit8a1e12499b83870f9f102f0f0ea512f0355aac67 (patch)
tree10b6fa2952890a6884bf8812b78ba99474c809b0 /test
parentc0a2d95cf318cf9b9ffe23f0a4b8720f69775448 (diff)
Ensure non-literal expressions shareable if `leteral`
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 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