summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2024-01-24 17:05:50 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-01-24 18:00:12 +0900
commit53d0cf442a1dfc1616a3870a65d5c867e0fec2dd (patch)
tree9a410a0213fdaf5a1e4acbeea0546f2e965a7ebd
parentc8355a8d1ff99ecd4f6ddd9db9013c365f002cf4 (diff)
Use exit 0 instead of true on windows platform
-rw-r--r--test/fiber/test_process.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/fiber/test_process.rb b/test/fiber/test_process.rb
index cc1694576e..a09b070c0a 100644
--- a/test/fiber/test_process.rb
+++ b/test/fiber/test_process.rb
@@ -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