Permalink
Browse files

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
  • Loading branch information...
1 parent 73fb923 commit 94b57518b19d0f8322e664e4ec7374199d037e48 @nobu nobu committed Dec 25, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 test/ripper/test_parser_events.rb
@@ -699,12 +699,15 @@ def test_opassign
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

0 comments on commit 94b5751

Please sign in to comment.