summaryrefslogtreecommitdiff
path: root/test/ripper/test_parser_events.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ripper/test_parser_events.rb')
-rw-r--r--test/ripper/test_parser_events.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index 59d4ad3987..1bae1e31ad 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -944,6 +944,10 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
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
+ thru_params = false
+ parse('a {|**nil|}', :on_params) {|_, *v| thru_params = true; arg = v}
+ assert_equal true, thru_params
+ assert_equal [nil, nil, nil, nil, nil, :nil, nil], arg
end
def test_params_mlhs
@@ -1153,6 +1157,12 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
assert_equal "x", thru_kwrest
end
+ def test_nokw_param
+ thru_nokw = false
+ parse('def a(**nil) end', :on_nokw_param) {|n, val| thru_nokw = val}
+ assert_equal nil, thru_nokw
+ end
+
def test_retry
thru_retry = false
parse('retry', :on_retry) {thru_retry = true}