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

ruby-changes:14099

From: knu <ko1@a...>
Date: Wed, 25 Nov 2009 15:11:28 +0900 (JST)
Subject: [ruby-changes:14099] Ruby:r25912 (ruby_1_8): * test/ruby/test_array.rb (TestArray#test_splat): Add tests for a

knu	2009-11-25 15:11:12 +0900 (Wed, 25 Nov 2009)

  New Revision: 25912

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

  Log:
    * test/ruby/test_array.rb (TestArray#test_splat): Add tests for a
      recently introduced bug in array splatting.

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/test/ruby/test_array.rb

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 25911)
+++ ruby_1_8/ChangeLog	(revision 25912)
@@ -1,3 +1,8 @@
+Wed Nov 25 15:06:42 2009  Akinori MUSHA  <knu@i...>
+
+	* test/ruby/test_array.rb (TestArray#test_splat): Add tests for a
+	  recently introduced bug in array splatting.
+
 Tue Nov 24 16:18:35 2009  Akinori MUSHA  <knu@i...>
 
 	* ext/digest/lib/md5.rb, ext/digest/lib/sha1.rb: Add an
Index: ruby_1_8/test/ruby/test_array.rb
===================================================================
--- ruby_1_8/test/ruby/test_array.rb	(revision 25911)
+++ ruby_1_8/test/ruby/test_array.rb	(revision 25912)
@@ -1276,4 +1276,11 @@
   def test_drop_while
     assert_equal([3,4,5,0], [1,2,3,4,5,0].drop_while {|i| i < 3 })
   end
+
+  def test_splat
+    a = [2,3]
+    assert_equal([1,2,3], [1, *a])
+    a = [2,3]
+    assert_equal([2,3], [*a])
+  end
 end

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

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