summaryrefslogtreecommitdiff
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb9
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;"}"