3 t1 = Thread.new { r.sysread(1) }
4 t2 = Thread.new { r.sysread(1) }
5 sleep 0.01 until t1.stop? and t2.stop?
18 w.write_nonblock("a" * 100000)
20 t1 = Thread.new { w.write("b" * 4096) }
21 t2 = Thread.new { w.write("c" * 4096) }
23 r.sysread(4096).length
25 r.sysread(4096).length
29 rescue LoadError, Timeout::Error, NotImplementedError
43 assert_equal 'ok', %q{
46 tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}"
47 rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL)
59 assert_equal 'ok', %q{
62 tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}"
63 rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL)
76 assert_equal 'ok', %q{
79 dupfd == STDIN.dup.fileno ? :ng : :ok
82 assert_normal_exit %q{
83 ARGF.set_encoding "foo"
87 assert_normal_exit %q{
90 megacontent = "abc" * 12345678
91 #File.open("megasrc", "w") {|f| f << megacontent }
94 Thread.new { sleep 0.001 until t0.stop?; Process.kill(:INT, $$) }
98 t1 = Thread.new { w1 << megacontent; w1.close }
99 t2 = Thread.new { r2.read; r2.close }
100 IO.copy_stream(r1, w2) rescue nil
105 }, 'megacontent-copy_stream', ["INT"], :timeout => 10 or break
108 assert_normal_exit %q{
111 STDOUT.reopen(__FILE__, "r")
112 }, '[ruby-dev:38131]'