diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 41d3640105..bd4326060c 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1609,4 +1609,18 @@ End t.close assert_raise(IOError) {t.binmode} end + + def test_threaded_flush + bug3585 = '[ruby-core:31348]' + src = %q{\ + t = Thread.new { sleep 3 } + Thread.new {sleep 1; t.kill; p 'hi!'} + t.join + }.gsub(/^\s+/, '') + 10.times.map do + Thread.start do + assert_in_out_err([], src, [%q["hi!"]]) + end + end.each {|th| th.join} + end end |