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.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index 80d455d7d5..a740c21ae9 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -132,9 +132,17 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
end
def test_args_forward
- thru_args_forward = false
- parse('def m(...) n(...) end', :on_args_forward) {thru_args_forward = true}
- assert_equal true, thru_args_forward
+ [
+ 'def m(...) n(...) end',
+ 'def m(...) end',
+ 'def m(a, ...) n(1, ...) end',
+ 'def m(...) n(1, ...) end',
+ 'def m(a, ...) n(...) end'
+ ].each do |code|
+ thru_args_forward = false
+ parse(code, :on_args_forward) {thru_args_forward = true}
+ assert_equal true, thru_args_forward, "no args_forward for: #{code}"
+ end
end
def test_arg_paren