1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_syntax.rb: test_brace_after_local_variable

* test/ruby/test_syntax.rb (test_brace_after_local_variable):
  another test using braces.  [Bug #11873]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-05-09 17:02:07 +00:00
parent 208240870a
commit 92fa667087

View file

@ -939,6 +939,15 @@ eom
assert_equal(:ok, result) assert_equal(:ok, result)
end end
def test_brace_after_local_variable
obj = Object.new
def obj.m; yield; end
result = assert_nothing_raised(SyntaxError) do
obj.instance_eval("m = 1; m {:ok}")
end
assert_equal(:ok, result)
end
def test_return_toplevel def test_return_toplevel
feature4840 = '[ruby-core:36785] [Feature #4840]' feature4840 = '[ruby-core:36785] [Feature #4840]'
code = "#{<<~"begin;"}\n#{<<~"end;"}" code = "#{<<~"begin;"}\n#{<<~"end;"}"