Skip to content

Commit 4eb085a

Browse files
committed
shareable_kwsplat_test
1 parent 300be2b commit 4eb085a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/ruby/test_parse.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,24 @@ class X
16091609
assert_ractor_shareable(a[0])
16101610
end
16111611

1612+
def test_shareable_constant_value_hash_with_keyword_splat
1613+
a, b = eval_separately("#{<<~"begin;"}\n#{<<~'end;'}")
1614+
begin;
1615+
# shareable_constant_value: experimental_everything
1616+
x = { x: {} }
1617+
y = { y: {} }
1618+
A = { **x }
1619+
B = { x: 1, **y }
1620+
[A, B]
1621+
end;
1622+
assert_ractor_shareable(a)
1623+
assert_ractor_shareable(b)
1624+
assert_equal({ x: {}}, a)
1625+
assert_equal({ x: 1, y: {}}, b)
1626+
rescue NotImplementedError
1627+
# Skip prism
1628+
end
1629+
16121630
def test_shareable_constant_value_unshareable_literal
16131631
assert_raise_separately(Ractor::IsolationError, /unshareable object to C/,
16141632
"#{<<~"begin;"}\n#{<<~'end;'}")

0 commit comments

Comments
 (0)