summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-23 11:19:30 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-23 11:19:30 +0000
commit7194acb65d91b866a90cc6e919cc136b84f17a13 (patch)
tree844fa1db0f2eda7219912e2d1511dbc68921279b /test
parent88d0a18c9fa3cfce8db9ee3fadc0cc15ee5730fe (diff)
merge revision(s) 40182,40221: [Backport #8311]
test_curses.rb: add sentinel * test/test_curses.rb (TestCurses#run_curses): add sentinel to get rid of read pty output after the child process terminated, which causes EIO on Linux. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/test_curses.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/test_curses.rb b/test/test_curses.rb
index d03a94173d..2e874eb2a3 100644
--- a/test/test_curses.rb
+++ b/test/test_curses.rb
@@ -28,14 +28,17 @@ rescue Exception => e
ensure
close_screen
puts "", [Marshal.dump([result, e])].pack('m').delete("\n")
+ print "\\0"
+ $stdio.flush
end
src
if input
w.print(input)
w.flush
end
- res = r.read
+ res = r.gets("\0")
return unless res
+ res.chomp!("\0")
res, error = Marshal.load(res[/(.*)\Z/, 1].unpack('m')[0])
raise error if error
return res