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:
parent
208240870a
commit
92fa667087
1 changed files with 9 additions and 0 deletions
|
@ -939,6 +939,15 @@ eom
|
|||
assert_equal(:ok, result)
|
||||
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
|
||||
feature4840 = '[ruby-core:36785] [Feature #4840]'
|
||||
code = "#{<<~"begin;"}\n#{<<~"end;"}"
|
||||
|
|
Loading…
Reference in a new issue