summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_call.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_call.rb b/test/ruby/test_call.rb
index 09146efa41..7c914b5c1a 100644
--- a/test/ruby/test_call.rb
+++ b/test/ruby/test_call.rb
@@ -327,6 +327,18 @@ class TestCall < Test::Unit::TestCase
assert_equal Hash, f(*[], **o).class
end
+ def test_call_args_splat_with_pos_arg_kw_splat_is_not_mutable
+ o = Object.new
+ def o.foo(a, **h)= h[:splat_modified] = true
+
+ a = []
+ b = {splat_modified: false}
+
+ o.foo(*a, :x, **b)
+
+ assert_equal({splat_modified: false}, b)
+ end
+
def test_kwsplat_block_order
o = Object.new
ary = []