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
@ -188,8 +188,9 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
|
|||||||
skip unless IO.method_defined?("getpass")
|
skip unless IO.method_defined?("getpass")
|
||||||
run_pty("p IO.console.getpass('> ')") do |r, w|
|
run_pty("p IO.console.getpass('> ')") do |r, w|
|
||||||
assert_equal("> ", r.readpartial(10))
|
assert_equal("> ", r.readpartial(10))
|
||||||
|
sleep 0.1
|
||||||
w.print "asdf\n"
|
w.print "asdf\n"
|
||||||
sleep 1
|
sleep 0.1
|
||||||
assert_equal("\r\n", r.gets)
|
assert_equal("\r\n", r.gets)
|
||||||
assert_equal("\"asdf\"", r.gets.chomp)
|
assert_equal("\"asdf\"", r.gets.chomp)
|
||||||
end
|
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.ioflush # ioflush may be issued after "a" is already sent.
|
||||||
s.print "b"
|
s.print "b"
|
||||||
s.flush
|
s.flush
|
||||||
|
sleep 0.1
|
||||||
assert_include(["b", "ab"], m.readpartial(10))
|
assert_include(["b", "ab"], m.readpartial(10))
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user