mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5e48356627
commit
2acc30eead
1 changed files with 11 additions and 0 deletions
|
@ -20,7 +20,9 @@ class TestIO_Console < Test::Unit::TestCase
|
||||||
PTY.open {|m, s|
|
PTY.open {|m, s|
|
||||||
assert(s.echo?)
|
assert(s.echo?)
|
||||||
m.print "a\n"
|
m.print "a\n"
|
||||||
|
sleep 0.1
|
||||||
s.print "b\n"
|
s.print "b\n"
|
||||||
|
sleep 0.1
|
||||||
assert_equal("a\r\nb\r\n", m.readpartial(10))
|
assert_equal("a\r\nb\r\n", m.readpartial(10))
|
||||||
assert_equal("a\n", s.readpartial(10))
|
assert_equal("a\n", s.readpartial(10))
|
||||||
s.noecho {
|
s.noecho {
|
||||||
|
@ -32,7 +34,9 @@ class TestIO_Console < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
assert(s.echo?)
|
assert(s.echo?)
|
||||||
m.print "a\n"
|
m.print "a\n"
|
||||||
|
sleep 0.1
|
||||||
s.print "b\n"
|
s.print "b\n"
|
||||||
|
sleep 0.1
|
||||||
assert_equal("a\r\nb\r\n", m.readpartial(10))
|
assert_equal("a\r\nb\r\n", m.readpartial(10))
|
||||||
assert_equal("a\n", s.readpartial(10))
|
assert_equal("a\n", s.readpartial(10))
|
||||||
}
|
}
|
||||||
|
@ -42,7 +46,9 @@ class TestIO_Console < Test::Unit::TestCase
|
||||||
PTY.open {|m, s|
|
PTY.open {|m, s|
|
||||||
assert(s.echo?)
|
assert(s.echo?)
|
||||||
m.print "a\n"
|
m.print "a\n"
|
||||||
|
sleep 0.1
|
||||||
s.print "b\n"
|
s.print "b\n"
|
||||||
|
sleep 0.1
|
||||||
assert_equal("a\r\nb\r\n", m.readpartial(10))
|
assert_equal("a\r\nb\r\n", m.readpartial(10))
|
||||||
assert_equal("a\n", s.readpartial(10))
|
assert_equal("a\n", s.readpartial(10))
|
||||||
s.echo = false
|
s.echo = false
|
||||||
|
@ -54,7 +60,9 @@ class TestIO_Console < Test::Unit::TestCase
|
||||||
s.echo = true
|
s.echo = true
|
||||||
assert(s.echo?)
|
assert(s.echo?)
|
||||||
m.print "a\n"
|
m.print "a\n"
|
||||||
|
sleep 0.1
|
||||||
s.print "b\n"
|
s.print "b\n"
|
||||||
|
sleep 0.1
|
||||||
assert_equal("a\r\nb\r\n", m.readpartial(10))
|
assert_equal("a\r\nb\r\n", m.readpartial(10))
|
||||||
assert_equal("a\n", s.readpartial(10))
|
assert_equal("a\n", s.readpartial(10))
|
||||||
}
|
}
|
||||||
|
@ -63,8 +71,11 @@ class TestIO_Console < Test::Unit::TestCase
|
||||||
def test_iflush
|
def test_iflush
|
||||||
PTY.open {|m, s|
|
PTY.open {|m, s|
|
||||||
m.print "a\n"
|
m.print "a\n"
|
||||||
|
sleep 0.1
|
||||||
s.iflush
|
s.iflush
|
||||||
|
sleep 0.1
|
||||||
m.print "b\n"
|
m.print "b\n"
|
||||||
|
sleep 0.1
|
||||||
assert_equal("a\r\nb\r\n", m.readpartial(10))
|
assert_equal("a\r\nb\r\n", m.readpartial(10))
|
||||||
assert_equal("b\n", s.readpartial(10))
|
assert_equal("b\n", s.readpartial(10))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue