diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-06 03:39:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-06 03:39:42 +0000 |
commit | 7a208f4b187f431d689bf4b08cfe30ef17a4d35c (patch) | |
tree | bd695e2b0f821e29ce056464226cc7cd2316fa0a /test/io | |
parent | c7495f996d672c0a132940951fa5d44e2c066a6f (diff) |
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
Diffstat (limited to 'test/io')
-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 9c2fe1ac54..d9868bf040 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -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?) |