summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-13 21:39:23 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-13 21:39:23 +0000
commit03eab41dfb142ee55f85635f96b4a5dca591e988 (patch)
treeb3d82b883917c511be7eb66776342277acb7ffb5 /test
parentdfdbfb6d5f9d7ef5a04c31c77f311542a79bb740 (diff)
Send input after curses is ready or raise error
On Linux, ncurses's initscr aborts with showing "Error opening terminal: unknown.". This fix can catch the error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/test_curses.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_curses.rb b/test/test_curses.rb
index 044ac96005..7a3ae4cf6b 100644
--- a/test/test_curses.rb
+++ b/test/test_curses.rb
@@ -22,6 +22,7 @@ include Curses
init_screen
begin
result = Timeout.timeout(#{timeout}) do
+ print "!"
#{src}
end
rescue Exception => e
@@ -32,6 +33,11 @@ ensure
$stdio.flush
end
src
+ wait = r.readpartial(1)
+ if wait != "!"
+ wait << r.readpartial(1000)
+ raise wait
+ end
if input
w.print(input)
w.flush