diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-25 00:30:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-25 00:30:47 +0000 |
commit | 94b57518b19d0f8322e664e4ec7374199d037e48 (patch) | |
tree | fcdafabebe9edcfa52485317ed7daee21172fbbe /test/ripper | |
parent | 73fb923cb3489e8f6505493282f025c751f5fcd4 (diff) | |
download | ruby-94b57518b19d0f8322e664e4ec7374199d037e48.tar.gz |
scoped constant op-assignment
* test/ripper/test_parser_events.rb (test_opassign): allow scoped
constant op-assignment. [ruby-core:40154] [Bug #5449]
* test/ripper/test_parser_events.rb (test_opassign_error): backref
opassign is only error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r-- | test/ripper/test_parser_events.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb index 2bb2c08a00..44180617ad 100644 --- a/test/ripper/test_parser_events.rb +++ b/test/ripper/test_parser_events.rb @@ -699,12 +699,15 @@ class TestRipper::ParserEvents < Test::Unit::TestCase thru_opassign = false parse('a ||= b', :on_opassign) {thru_opassign = true} assert_equal true, thru_opassign + thru_opassign = false + parse('a::X ||= c 1', :on_opassign) {thru_opassign = true} + assert_equal true, thru_opassign end def test_opassign_error thru_opassign = [] events = [:on_opassign] - parse('a::X ||= c 1', events) {|a,*b| + parse('$~ ||= 1', events) {|a,*b| thru_opassign << a } assert_equal events, thru_opassign |