diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-03-05 17:40:39 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-03-07 09:54:35 +0900 |
commit | f6d5de8f33fe715d939e3e77b8ef73d88bcd6c9f (patch) | |
tree | 64b32ed677f3e0ee9a97e7c454d12a714d72e0de /test/io/wait | |
parent | ea81fff56443d49099fb746bc06c4f239fe5e647 (diff) | |
download | ruby-f6d5de8f33fe715d939e3e77b8ef73d88bcd6c9f.tar.gz |
[ruby/io-wait] Declare as Ractor-safe
Fixes https://bugs.ruby-lang.org/issues/17659
https://github.com/ruby/io-wait/commit/ba338b4764
Diffstat (limited to 'test/io/wait')
-rw-r--r-- | test/io/wait/test_ractor.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/io/wait/test_ractor.rb b/test/io/wait/test_ractor.rb new file mode 100644 index 0000000000..3d286af77f --- /dev/null +++ b/test/io/wait/test_ractor.rb @@ -0,0 +1,22 @@ +# 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 |