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
|
ensure
|
||||||
close_screen
|
close_screen
|
||||||
puts "", [Marshal.dump([result, e])].pack('m').delete("\n")
|
puts "", [Marshal.dump([result, e])].pack('m').delete("\n")
|
||||||
|
print "\\0"
|
||||||
end
|
end
|
||||||
src
|
src
|
||||||
if input
|
if input
|
||||||
w.print(input)
|
w.print(input)
|
||||||
w.flush
|
w.flush
|
||||||
end
|
end
|
||||||
res = r.read
|
res = r.gets("\0")
|
||||||
return unless res
|
return unless res
|
||||||
|
res.chomp!("\0")
|
||||||
res, error = Marshal.load(res[/(.*)\Z/, 1].unpack('m')[0])
|
res, error = Marshal.load(res[/(.*)\Z/, 1].unpack('m')[0])
|
||||||
raise error if error
|
raise error if error
|
||||||
return res
|
return res
|
||||||
|
|
Loading…
Add table
Reference in a new issue