Use exit 0 instead of true on windows platform
This commit is contained in:
parent
c8355a8d1f
commit
53d0cf442a
@ -3,13 +3,15 @@ require 'test/unit'
|
|||||||
require_relative 'scheduler'
|
require_relative 'scheduler'
|
||||||
|
|
||||||
class TestFiberProcess < Test::Unit::TestCase
|
class TestFiberProcess < Test::Unit::TestCase
|
||||||
|
TRUE_CMD = RUBY_PLATFORM =~ /mswin|mingw/ ? "exit 0" : "true"
|
||||||
|
|
||||||
def test_process_wait
|
def test_process_wait
|
||||||
Thread.new do
|
Thread.new do
|
||||||
scheduler = Scheduler.new
|
scheduler = Scheduler.new
|
||||||
Fiber.set_scheduler scheduler
|
Fiber.set_scheduler scheduler
|
||||||
|
|
||||||
Fiber.schedule do
|
Fiber.schedule do
|
||||||
pid = Process.spawn("true")
|
pid = Process.spawn(TRUE_CMD)
|
||||||
Process.wait(pid)
|
Process.wait(pid)
|
||||||
|
|
||||||
# TODO test that scheduler was invoked.
|
# TODO test that scheduler was invoked.
|
||||||
@ -25,7 +27,7 @@ class TestFiberProcess < Test::Unit::TestCase
|
|||||||
Fiber.set_scheduler scheduler
|
Fiber.set_scheduler scheduler
|
||||||
|
|
||||||
Fiber.schedule do
|
Fiber.schedule do
|
||||||
system("true")
|
system(TRUE_CMD)
|
||||||
|
|
||||||
# TODO test that scheduler was invoked (currently it's not).
|
# TODO test that scheduler was invoked (currently it's not).
|
||||||
|
|
||||||
@ -49,7 +51,7 @@ class TestFiberProcess < Test::Unit::TestCase
|
|||||||
|
|
||||||
Fiber.schedule do
|
Fiber.schedule do
|
||||||
assert_raise TypeError do
|
assert_raise TypeError do
|
||||||
system("true")
|
system(TRUE_CMD)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end.join
|
end.join
|
||||||
|
Loading…
x
Reference in New Issue
Block a user