[前][次][番号順一覧][スレッド一覧]

ruby-changes:46517

From: nobu <ko1@a...>
Date: Wed, 10 May 2017 02:02:13 +0900 (JST)
Subject: [ruby-changes:46517] nobu:r58638 (trunk): test_syntax.rb: test_brace_after_local_variable

nobu	2017-05-10 02:02:07 +0900 (Wed, 10 May 2017)

  New Revision: 58638

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58638

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

  Modified files:
    trunk/test/ruby/test_syntax.rb
Index: test/ruby/test_syntax.rb
===================================================================
--- test/ruby/test_syntax.rb	(revision 58637)
+++ test/ruby/test_syntax.rb	(revision 58638)
@@ -939,6 +939,15 @@ eom https://github.com/ruby/ruby/blob/trunk/test/ruby/test_syntax.rb#L939
     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;"}"

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]