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

ruby-changes:39002

From: hsbt <ko1@a...>
Date: Wed, 1 Jul 2015 10:55:11 +0900 (JST)
Subject: [ruby-changes:39002] hsbt:r51083 (trunk): * Add test for Enumerable#none? [fix GH-950] Patch by @yui-knk

hsbt	2015-07-01 10:55:03 +0900 (Wed, 01 Jul 2015)

  New Revision: 51083

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

  Log:
    * Add test for Enumerable#none? [fix GH-950] Patch by @yui-knk

  Modified files:
    trunk/ChangeLog
    trunk/enum.c
    trunk/test/ruby/test_enum.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51082)
+++ ChangeLog	(revision 51083)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jul  1 10:54:56 2015  SHIBATA Hiroshi  <hsbt@r...>
+
+	* Add test for Enumerable#none? [fix GH-950] Patch by @yui-knk
+
 Wed Jul  1 09:30:36 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* struct.c (struct_set_members): hide internal back_members
Index: enum.c
===================================================================
--- enum.c	(revision 51082)
+++ enum.c	(revision 51083)
@@ -1401,6 +1401,7 @@ DEFINE_ENUMFUNCS(none) https://github.com/ruby/ruby/blob/trunk/enum.c#L1401
  *     [].none?                                           #=> true
  *     [nil].none?                                        #=> true
  *     [nil, false].none?                                 #=> true
+ *     [nil, false, true].none?                           #=> false
  */
 static VALUE
 enum_none(VALUE obj)
Index: test/ruby/test_enum.rb
===================================================================
--- test/ruby/test_enum.rb	(revision 51082)
+++ test/ruby/test_enum.rb	(revision 51083)
@@ -265,6 +265,7 @@ class TestEnumerable < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/ruby/test_enum.rb#L265
     assert([].none?)
     assert([nil].none?)
     assert([nil,false].none?)
+    assert(![nil,false,true].none?)
   end
 
   def test_min

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

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