diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-18 07:12:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-18 07:12:14 +0000 |
commit | 3723ac22d23ad8675d9aad2f1df229b0c81e31cd (patch) | |
tree | 57f3346600cde955e45a4bb72a7224682bc57222 /test | |
parent | 7491541e1602d2cf9b29783abadf802f1f50251c (diff) | |
download | ruby-3723ac22d23ad8675d9aad2f1df229b0c81e31cd.tar.gz |
* 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/trunk@33785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/io/console/test_io_console.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 3420248415..05ab1a353e 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -19,6 +19,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?) |