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

ruby-changes:33236

From: nobu <ko1@a...>
Date: Tue, 11 Mar 2014 14:16:09 +0900 (JST)
Subject: [ruby-changes:33236] nobu:r45315 (trunk): test_hash.rb: refine a test

nobu	2014-03-11 14:16:06 +0900 (Tue, 11 Mar 2014)

  New Revision: 45315

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

  Log:
    test_hash.rb: refine a test
    
    * test/ruby/test_hash.rb (test_exception_in_rehash): do not run twice
      since this test does not use @cls.  making a hash may increase
      memory usage and should be in preparation.

  Modified files:
    trunk/test/ruby/test_hash.rb
Index: test/ruby/test_hash.rb
===================================================================
--- test/ruby/test_hash.rb	(revision 45314)
+++ test/ruby/test_hash.rb	(revision 45315)
@@ -1208,6 +1208,8 @@ class TestHash < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_hash.rb#L1208
   end
 
   def test_exception_in_rehash
+    return unless @cls == Hash
+
     bug9187 = '[ruby-core:58728] [Bug #9187]'
 
     prepare = <<-EOS
@@ -1222,10 +1224,10 @@ class TestHash < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_hash.rb#L1224
         return 0
       end
     end
+    h = {Foo.new => true}
     EOS
 
     code = <<-EOS
-    h = {Foo.new => true}
     10_0000.times do
       h.rehash rescue nil
     end

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

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