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

ruby-changes:39342

From: nobu <ko1@a...>
Date: Wed, 29 Jul 2015 14:06:49 +0900 (JST)
Subject: [ruby-changes:39342] nobu:r51423 (trunk): test_hash.rb: add assertions

nobu	2015-07-29 14:06:32 +0900 (Wed, 29 Jul 2015)

  New Revision: 51423

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

  Log:
    test_hash.rb: add assertions
    
    * test/ruby/test_hash.rb (test_wrapper_of_special_const): test
      other special obejcts.  [Bug #9381]

  Modified files:
    trunk/test/ruby/test_hash.rb
Index: test/ruby/test_hash.rb
===================================================================
--- test/ruby/test_hash.rb	(revision 51422)
+++ test/ruby/test_hash.rb	(revision 51423)
@@ -1279,8 +1279,13 @@ class TestHash < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_hash.rb#L1279
       end
     end
 
-    hash = {5 => bug9381}
-    assert_equal(bug9381, hash[wrapper.new(5)])
+    bad = [
+      5, true, false, nil,
+    ].select do |x|
+      hash = {x => bug9381}
+      hash[wrapper.new(x)] != bug9381
+    end
+    assert_empty(bad, bug9381)
   end
 
   def test_label_syntax

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

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