Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use exit 0 instead of true on windows platform #9671

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/fiber/test_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
require_relative 'scheduler'

class TestFiberProcess < Test::Unit::TestCase
TRUE_CMD = RUBY_PLATFORM =~ /mswin|mingw/ ? "exit 0" : "true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TRUE_CMD = "exit"


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.
Expand All @@ -25,7 +27,7 @@ def test_system
Fiber.set_scheduler scheduler

Fiber.schedule do
system("true")
system(TRUE_CMD)

# TODO test that scheduler was invoked (currently it's not).

Expand All @@ -49,7 +51,7 @@ def scheduler.process_wait(pid, flags)

Fiber.schedule do
assert_raise TypeError do
system("true")
system(TRUE_CMD)
end
end
end.join
Expand Down