From 6b9c2e9d77cc2c9003dec9eac890e48af7dbc732 Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 19 Feb 2010 07:01:11 +0000 Subject: [PATCH] Use only object_id to test living threads. Previous test depends on timing like: <"[#, #, #]"> expected but was <"[#, #, #]">. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_thread.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index 6707fc4a29..3c10cce3c3 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -232,8 +232,8 @@ class TestThread < Test::Unit::TestCase Thread.pass t2 = Thread.new { loop { } } t3 = Thread.new { }.join - p [Thread.current, t1, t2].sort_by {|t| t.object_id } - p Thread.list.sort_by {|t| t.object_id } + p [Thread.current, t1, t2].map{|t| t.object_id }.sort + p Thread.list.map{|t| t.object_id }.sort INPUT assert_equal(r.first, r.last) assert_equal([], e)