aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-29 05:46:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-29 05:46:23 +0000
commitb3283011100956820c14c09a6bca4ba7dcfb5520 (patch)
tree2b9f676fed49aaef4d5e0a9851a8919cc2eea413 /test/ruby
parent223f9d2170b233ee395e06570b9aa8de53ff31b6 (diff)
downloadruby-b3283011100956820c14c09a6bca4ba7dcfb5520.tar.gz
io.c: honor buffered mode
* io.c (io_writev): honor buffered mode to get rid of broken pipe error when stdout is redirected to a pipeline. [ruby-core:83578] [Feature #14042] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_io.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 0bedebfc16..a12cda6277 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1274,6 +1274,15 @@ class TestIO < Test::Unit::TestCase
assert_in_out_err([], "STDOUT.write(:foo, :bar)", ["foobar"])
end
+ def test_write_buffered_with_multiple_arguments
+ out, err, (_, status) = EnvUtil.invoke_ruby(["-e", "sleep 0.1;puts 'foo'"], "", true, true) do |_, o, e, i|
+ [o.read, e.read, Process.waitpid2(i)]
+ end
+ assert_predicate(status, :success?)
+ assert_equal("foo\n", out)
+ assert_empty(err)
+ end
+
def test_write_non_writable
with_pipe do |r, w|
assert_raise(IOError) do