Use assert_normal_exit to split process

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-10-29 08:52:59 +00:00
parent 78625e5852
commit 897a3fce91

View File

@ -47,20 +47,21 @@ class TestFiber < Test::Unit::TestCase
end end
def test_many_fibers_with_threads def test_many_fibers_with_threads
max = 1000 assert_normal_exit %q{
@cnt = 0 max = 1000
(1..100).map{|ti| @cnt = 0
Thread.new{ (1..100).map{|ti|
max.times{|i| Thread.new{
Fiber.new{ max.times{|i|
@cnt += 1 Fiber.new{
}.resume @cnt += 1
}.resume
}
} }
}.each{|t|
t.join
} }
}.each{|t|
t.join
} }
assert_equal(:ok, :ok)
end end
def test_error def test_error