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

ruby-changes:32099

From: nobu <ko1@a...>
Date: Fri, 13 Dec 2013 23:50:15 +0900 (JST)
Subject: [ruby-changes:32099] nobu:r44178 (trunk): test_weakmap.rb: fix test

nobu	2013-12-13 23:50:00 +0900 (Fri, 13 Dec 2013)

  New Revision: 44178

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

  Log:
    test_weakmap.rb: fix test
    
    * test/ruby/test_weakmap.rb (test_include?): create target object in a
      block, so that collected soon as possible.

  Modified files:
    trunk/test/ruby/test_weakmap.rb
Index: test/ruby/test_weakmap.rb
===================================================================
--- test/ruby/test_weakmap.rb	(revision 44177)
+++ test/ruby/test_weakmap.rb	(revision 44178)
@@ -31,7 +31,8 @@ class TestWeakMap < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_weakmap.rb#L31
   def test_include?
     m = __callee__[/test_(.*)/, 1]
     k = "foo"
-    Object.new.tap do |x|
+    1.times do
+      x = Object.new
       @wm[k] = x
       assert_send([@wm, m, k])
       assert_not_send([@wm, m, "FOO".downcase])

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

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