1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/io/wait/test_ractor.rb
NARUSE, Yui e050dd5323 merge revision(s) f6d5de8f33: [Backport #17659]
[ruby/io-wait] Declare as Ractor-safe

	Fixes https://bugs.ruby-lang.org/issues/17659

	ba338b4764
	---
	 ext/io/wait/wait.c          |  4 ++++
	 test/io/wait/test_ractor.rb | 22 ++++++++++++++++++++++
	 2 files changed, 26 insertions(+)
	 create mode 100644 test/io/wait/test_ractor.rb
2021-03-13 17:56:17 +09:00

22 lines
503 B
Ruby

# frozen_string_literal: true
require 'test/unit'
require 'rbconfig'
require 'io/wait'
class TestIOWaitInRactor < Test::Unit::TestCase
def setup
omit unless defined? Ractor
end
def test_ractor
ext = "/io/wait.#{RbConfig::CONFIG['DLEXT']}"
path = $".find {|path| path.end_with?(ext)}
assert_in_out_err(%W[-r#{path}], <<-"end;", ["true"], [])
$VERBOSE = nil
r = Ractor.new do
$stdout.equal?($stdout.wait_writable)
end
puts r.take
end;
end
end