mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 02:53:57 +02:00
merge revision(s) 33785:
* ext/io/console/console.c (console_cooked, console_set_cooked): new methods to reset cooked mode. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c7495f996d
commit
7a208f4b18
4 changed files with 77 additions and 3 deletions
|
@ -20,6 +20,21 @@ class TestIO_Console < Test::Unit::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
def test_cooked
|
||||
helper {|m, s|
|
||||
s.raw {
|
||||
s.print "abc\n"
|
||||
assert_equal("abc\n", m.gets)
|
||||
s.cooked {
|
||||
s.print "def\n"
|
||||
assert_equal("def\r\n", m.gets)
|
||||
}
|
||||
}
|
||||
s.print "ghi\n"
|
||||
assert_equal("ghi\r\n", m.gets)
|
||||
}
|
||||
end
|
||||
|
||||
def test_echo
|
||||
helper {|m, s|
|
||||
assert(s.echo?)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue