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:
nobu 2012-03-06 03:39:42 +00:00
parent c7495f996d
commit 7a208f4b18
4 changed files with 77 additions and 3 deletions

View file

@ -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?)