Skip to content

Commit

Permalink
shareable_kwsplat_test
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng committed Dec 12, 2024
1 parent 300be2b commit 4eb085a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/ruby/test_parse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,24 @@ class X
assert_ractor_shareable(a[0])
end

def test_shareable_constant_value_hash_with_keyword_splat
a, b = eval_separately("#{<<~"begin;"}\n#{<<~'end;'}")
begin;
# shareable_constant_value: experimental_everything
x = { x: {} }
y = { y: {} }
A = { **x }
B = { x: 1, **y }
[A, B]
end;
assert_ractor_shareable(a)
assert_ractor_shareable(b)
assert_equal({ x: {}}, a)
assert_equal({ x: 1, y: {}}, b)
rescue NotImplementedError
# Skip prism
end

def test_shareable_constant_value_unshareable_literal
assert_raise_separately(Ractor::IsolationError, /unshareable object to C/,
"#{<<~"begin;"}\n#{<<~'end;'}")
Expand Down

0 comments on commit 4eb085a

Please sign in to comment.