mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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/trunk@40182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5865e7604c
commit
6779f24eb5
1 changed files with 3 additions and 1 deletions
|
@ -28,14 +28,16 @@ rescue Exception => e
|
|||
ensure
|
||||
close_screen
|
||||
puts "", [Marshal.dump([result, e])].pack('m').delete("\n")
|
||||
print "\\0"
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue