test/io/wait/test_ractor.rb
raw| 1 | # frozen_string_literal: true |
| 2 | require 'test/unit' |
| 3 | require 'rbconfig' |
| 4 | |
| 5 | class TestIOWaitInRactor < Test::Unit::TestCase |
| 6 | def test_ractor |
| 7 | ext = "/io/wait.#{RbConfig::CONFIG['DLEXT']}" |
| 8 | path = $".find {|path| path.end_with?(ext)} |
| 9 | assert_in_out_err(%W[-r#{path}], <<-"end;", ["true"], []) |
| 10 | $VERBOSE = nil |
| 11 | r = Ractor.new do |
| 12 | $stdout.equal?($stdout.wait_writable) |
| 13 | end |
| 14 | puts r.take |
| 15 | end; |
| 16 | end |
| 17 | end if defined? Ractor |