From 92fa66708769914695ac1765f9deb54e555ede46 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 9 May 2017 17:02:07 +0000 Subject: [PATCH] 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 --- test/ruby/test_syntax.rb | 9 +++++++++ 1 file changed, 9 insertions(+) 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;"}"