diff options
Diffstat (limited to 'test/ripper/test_parser_events.rb')
-rw-r--r-- | test/ripper/test_parser_events.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb index c9189ee7a8..03580107a0 100644 --- a/test/ripper/test_parser_events.rb +++ b/test/ripper/test_parser_events.rb @@ -893,7 +893,7 @@ class TestRipper::ParserEvents < Test::Unit::TestCase thru_params = false parse('a {|**x|}', :on_params) {|_, *v| thru_params = true; arg = v} assert_equal true, thru_params - assert_equal [nil, nil, nil, nil, nil, "x", nil], arg + assert_equal [nil, nil, nil, nil, nil, "**x", nil], arg end def test_params_mlhs @@ -1079,6 +1079,15 @@ class TestRipper::ParserEvents < Test::Unit::TestCase assert_equal true, thru_rest_param end + def test_kwrest_param + thru_kwrest = false + parse('def a(**) end', :on_kwrest_param) {|n, val| thru_kwrest = val} + assert_equal nil, thru_kwrest + thru_kwrest = false + parse('def a(**x) end', :on_kwrest_param) {|n, val| thru_kwrest = val} + assert_equal "x", thru_kwrest + end + def test_retry thru_retry = false parse('retry', :on_retry) {thru_retry = true} |