diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-19 07:01:11 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-19 07:01:11 +0000 |
commit | 6b9c2e9d77cc2c9003dec9eac890e48af7dbc732 (patch) | |
tree | 11868a9f96b805760b4b3f74297dcd2be96bc906 | |
parent | c840e4578f49df89840a3aed3102ca201fb13f57 (diff) | |
download | ruby-6b9c2e9d77cc2c9003dec9eac890e48af7dbc732.tar.gz |
Use only object_id to test living threads.
Previous test depends on timing like:
<"[#<Thread:0x000008013413a0 run>, #<Thread:0x00000801341418 run>,
#<Thread:0x00000801364940 run>]"> expected but was
<"[#<Thread:0x000008013413a0 run>, #<Thread:0x00000801341418 sleep>,
#<Thread:0x00000801364940 run>]">.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_thread.rb | 4 |
1 files 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) |