зеркало из https://github.com/github/ruby.git
Use exit 0 instead of true on windows platform
This commit is contained in:
Родитель
c8355a8d1f
Коммит
53d0cf442a
|
@ -3,13 +3,15 @@ require 'test/unit'
|
|||
require_relative 'scheduler'
|
||||
|
||||
class TestFiberProcess < Test::Unit::TestCase
|
||||
TRUE_CMD = RUBY_PLATFORM =~ /mswin|mingw/ ? "exit 0" : "true"
|
||||
|
||||
def test_process_wait
|
||||
Thread.new do
|
||||
scheduler = Scheduler.new
|
||||
Fiber.set_scheduler scheduler
|
||||
|
||||
Fiber.schedule do
|
||||
pid = Process.spawn("true")
|
||||
pid = Process.spawn(TRUE_CMD)
|
||||
Process.wait(pid)
|
||||
|
||||
# TODO test that scheduler was invoked.
|
||||
|
@ -25,7 +27,7 @@ class TestFiberProcess < Test::Unit::TestCase
|
|||
Fiber.set_scheduler scheduler
|
||||
|
||||
Fiber.schedule do
|
||||
system("true")
|
||||
system(TRUE_CMD)
|
||||
|
||||
# TODO test that scheduler was invoked (currently it's not).
|
||||
|
||||
|
@ -49,7 +51,7 @@ class TestFiberProcess < Test::Unit::TestCase
|
|||
|
||||
Fiber.schedule do
|
||||
assert_raise TypeError do
|
||||
system("true")
|
||||
system(TRUE_CMD)
|
||||
end
|
||||
end
|
||||
end.join
|
||||
|
|
Загрузка…
Ссылка в новой задаче