mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_io_console.rb: get rid of sporadic failures
* test/io/console/test_io_console.rb (test_getpass): try to get rid of timing issues. * test/io/console/test_io_console.rb (test_ioflush2): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
eb8c2773cb
commit
ac40fc997b
1 changed files with 3 additions and 1 deletions
|
@ -188,8 +188,9 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
|
|||
skip unless IO.method_defined?("getpass")
|
||||
run_pty("p IO.console.getpass('> ')") do |r, w|
|
||||
assert_equal("> ", r.readpartial(10))
|
||||
sleep 0.1
|
||||
w.print "asdf\n"
|
||||
sleep 1
|
||||
sleep 0.1
|
||||
assert_equal("\r\n", r.gets)
|
||||
assert_equal("\"asdf\"", r.gets.chomp)
|
||||
end
|
||||
|
@ -231,6 +232,7 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
|
|||
s.ioflush # ioflush may be issued after "a" is already sent.
|
||||
s.print "b"
|
||||
s.flush
|
||||
sleep 0.1
|
||||
assert_include(["b", "ab"], m.readpartial(10))
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue