diff options
author | Shugo Maeda <shugo@ruby-lang.org> | 2022-11-16 23:03:39 +0900 |
---|---|---|
committer | Shugo Maeda <shugo.maeda@gmail.com> | 2022-11-18 18:23:06 +0900 |
commit | ddd62fadaf91418cd259593285bc59358fb0b166 (patch) | |
tree | 6f91cd01559f43f942774d36f892b1d2ed61617b /test | |
parent | 00872d120b017de2270fe18068cea2d37d41ed71 (diff) | |
download | ruby-ddd62fadaf91418cd259593285bc59358fb0b166.tar.gz |
Allow anonymous keyword rest parameter with other keyword parameters
Fixes [Bug #19132]
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_ast.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_syntax.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 0932e93d5a..7af6e43e1d 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -469,7 +469,7 @@ class TestAst < Test::Unit::TestCase end assert_equal(nil, kwrest.call('')) - assert_equal([nil], kwrest.call('**')) + assert_equal([:**], kwrest.call('**')) assert_equal(false, kwrest.call('**nil')) assert_equal([:a], kwrest.call('**a')) end diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index b0ad012131..7a5f4c9528 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -163,9 +163,11 @@ class TestSyntax < Test::Unit::TestCase def c(**kw); kw end def d(**); b(k: 1, **) end def e(**); b(**, k: 1) end + def f(a: nil, **); b(**) end assert_equal({a: 1, k: 3}, b(a: 1, k: 3)) assert_equal({a: 1, k: 3}, d(a: 1, k: 3)) assert_equal({a: 1, k: 1}, e(a: 1, k: 3)) + assert_equal({k: 3}, f(a: 1, k: 3)) end; end |