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

ruby-changes:26536

From: nobu <ko1@a...>
Date: Tue, 25 Dec 2012 09:31:12 +0900 (JST)
Subject: [ruby-changes:26536] nobu:r38587 (trunk): scoped constant op-assignment

nobu	2012-12-25 09:30:47 +0900 (Tue, 25 Dec 2012)

  New Revision: 38587

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38587

  Log:
    scoped constant op-assignment
    
    * test/ripper/test_parser_events.rb (test_opassign): allow scoped
      constant op-assignment.  [ruby-core:40154] [Bug #5449]
    
    * test/ripper/test_parser_events.rb (test_opassign_error): backref
      opassign is only error.

  Modified files:
    trunk/test/ripper/test_parser_events.rb

Index: test/ripper/test_parser_events.rb
===================================================================
--- test/ripper/test_parser_events.rb	(revision 38586)
+++ test/ripper/test_parser_events.rb	(revision 38587)
@@ -699,12 +699,15 @@ class TestRipper::ParserEvents < Test::U https://github.com/ruby/ruby/blob/trunk/test/ripper/test_parser_events.rb#L699
     thru_opassign = false
     parse('a ||= b', :on_opassign) {thru_opassign = true}
     assert_equal true, thru_opassign
+    thru_opassign = false
+    parse('a::X ||= c 1', :on_opassign) {thru_opassign = true}
+    assert_equal true, thru_opassign
   end
 
   def test_opassign_error
     thru_opassign = []
     events = [:on_opassign]
-    parse('a::X ||= c 1', events) {|a,*b|
+    parse('$~ ||= 1', events) {|a,*b|
       thru_opassign << a
     }
     assert_equal events, thru_opassign

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

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