aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-08 05:12:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-08 05:12:08 +0000
commit6779f24eb5fc49805b65a7a5b270e0130269754b (patch)
treeeb552e8ec3b079543998383c3ac890d1dd37d405 /test
parent5865e7604c1f2e5d04f4d8ff5ec5f1449da26e59 (diff)
downloadruby-6779f24eb5fc49805b65a7a5b270e0130269754b.tar.gz
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
Diffstat (limited to 'test')
-rw-r--r--test/test_curses.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/test_curses.rb b/test/test_curses.rb
index 9432c024bb..752fa47c29 100644
--- a/test/test_curses.rb
+++ b/test/test_curses.rb
@@ -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