diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-09 17:02:07 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-09 17:02:07 +0000 |
commit | 92fa66708769914695ac1765f9deb54e555ede46 (patch) | |
tree | 10accc27646a4b30eff9b537f99b0e354f44b2da /test/ruby/test_syntax.rb | |
parent | 208240870a7e75088f6216dd7a85a770c7912dd0 (diff) | |
download | ruby-92fa66708769914695ac1765f9deb54e555ede46.tar.gz |
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
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r-- | test/ruby/test_syntax.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 5cfc13ec89..640fbb9b64 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -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;"}" |