diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2024-09-02 03:19:13 -0700 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2024-09-02 03:19:13 -0700 |
| commit | cf9a6c2b63e6337a3f6ce76527446739e5aceb67 (patch) | |
| tree | 08ec41bbd573dca488cf34b976f4bd13ec3e40ca /test/ruby | |
| parent | d83b5633b16f4ddcece4ff924f21c5a5851470cf (diff) | |
merge revision(s) a3562c2a0abf1c2bdd1d50377b4f929580782594: [Backport #20701]
Remove incorrect setting of KW_SPLAT_MUT flag
Fixes [Bug #20701]
Co-authored-by: Pablo Herrero <pablodherrero@gmail.com>
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_call.rb | 12 |
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 = [] |
