mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
73fb923cb3
commit
94b57518b1
1 changed files with 4 additions and 1 deletions
|
|
@ -699,12 +699,15 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
|
||||||
thru_opassign = false
|
thru_opassign = false
|
||||||
parse('a ||= b', :on_opassign) {thru_opassign = true}
|
parse('a ||= b', :on_opassign) {thru_opassign = true}
|
||||||
assert_equal true, thru_opassign
|
assert_equal true, thru_opassign
|
||||||
|
thru_opassign = false
|
||||||
|
parse('a::X ||= c 1', :on_opassign) {thru_opassign = true}
|
||||||
|
assert_equal true, thru_opassign
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_opassign_error
|
def test_opassign_error
|
||||||
thru_opassign = []
|
thru_opassign = []
|
||||||
events = [:on_opassign]
|
events = [:on_opassign]
|
||||||
parse('a::X ||= c 1', events) {|a,*b|
|
parse('$~ ||= 1', events) {|a,*b|
|
||||||
thru_opassign << a
|
thru_opassign << a
|
||||||
}
|
}
|
||||||
assert_equal events, thru_opassign
|
assert_equal events, thru_opassign
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue