зеркало из https://github.com/github/ruby.git
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:
Родитель
73fb923cb3
Коммит
94b57518b1
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче