summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_parse.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index c2f02ff809..341d63c38a 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -1475,6 +1475,21 @@ x = __ENCODING__
assert !obj.equal?(a)
end
+ def test_shareable_constant_value_literal_const_refs
+ a = eval_separately("#{<<~"begin;"}\n#{<<~'end;'}")
+ begin;
+ # shareable_constant_value: literal
+ # [Bug #20668]
+ SOME_CONST = {
+ 'Object' => Object,
+ 'String' => String,
+ 'Array' => Array,
+ }
+ SOME_CONST
+ end;
+ assert_ractor_shareable(a)
+ end
+
def test_shareable_constant_value_nested
a, b = eval_separately("#{<<~"begin;"}\n#{<<~'end;'}")
begin;