aboutsummaryrefslogtreecommitdiffstats
path: root/test/ripper
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-06 19:31:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-06 19:31:33 +0000
commitc1d84bfcdb113364f9fcdef94a07961613743ff3 (patch)
tree93316d146bfaf6e1c507dc391858aab274ca8a82 /test/ripper
parentca252765bcfd1b05189a73e366d361d4eefbd988 (diff)
downloadruby-c1d84bfcdb113364f9fcdef94a07961613743ff3.tar.gz
* parse.y (arg): rescue_mod is in inverse order from other
modifiers. patched by michael.j.edgar AT dartmouth.edu at [ruby-core:36248]. fixed #4716. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r--test/ripper/test_parser_events.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index 9f97dbae20..14799d39e7 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -777,14 +777,18 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
def test_rescue
thru_rescue = false
- parse('begin; rescue; end', :on_rescue) {thru_rescue = true}
+ parsed = parse('begin; 1; rescue => e; 2; end', :on_rescue) {thru_rescue = true}
assert_equal true, thru_rescue
+ assert_match /1.*rescue/, parsed
+ assert_match /rescue\(,var_field\(e\),\[2\]\)/, parsed
end
def test_rescue_mod
thru_rescue_mod = false
- parse('nil rescue nil', :on_rescue_mod) {thru_rescue_mod = true}
+ parsed = parse('1 rescue 2', :on_rescue_mod) {thru_rescue_mod = true}
assert_equal true, thru_rescue_mod
+ bug4716 = '[ruby-core:36248]'
+ assert_equal "[rescue_mod(1,2)]", parsed, bug4716
end
def test_rest_param