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

ruby-changes:45637

From: normal <ko1@a...>
Date: Sat, 25 Feb 2017 11:31:08 +0900 (JST)
Subject: [ruby-changes:45637] normal:r57710 (trunk): NEWS: document String#-@ change

normal	2017-02-25 11:31:03 +0900 (Sat, 25 Feb 2017)

  New Revision: 57710

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

  Log:
    NEWS: document String#-@ change
    
    * test/ruby/test_string.rb (test_uplus_minus): test deduplication
      [ruby-core:79747] [Feature #13077]

  Modified files:
    trunk/NEWS
    trunk/test/ruby/test_string.rb
Index: test/ruby/test_string.rb
===================================================================
--- test/ruby/test_string.rb	(revision 57709)
+++ test/ruby/test_string.rb	(revision 57710)
@@ -2537,6 +2537,8 @@ CODE https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L2537
 
     assert_not_equal(str.object_id, (+str).object_id)
     assert_equal(str.object_id, (-str).object_id)
+    bar = %w(b a r).join('')
+    assert_same(str, -bar, "uminus deduplicates [Feature #13077]")
   end
 
   def test_ord
Index: NEWS
===================================================================
--- NEWS	(revision 57709)
+++ NEWS	(revision 57710)
@@ -28,6 +28,11 @@ with all sufficient information, see the https://github.com/ruby/ruby/blob/trunk/NEWS#L28
 
   * Thread#fetch  [Feature #13009]
 
+* String
+
+  * String#-@ deduplicates unfrozen strings.  Already-frozen
+    strings remain unchanged for compatibility.  [Feature #13077]
+
 === Stdlib updates (outstanding ones only)
 
 === Compatibility issues (excluding feature bug fixes)

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

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