summaryrefslogtreecommitdiff
path: root/test/io/console
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-18 07:12:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-18 07:12:14 +0000
commit3723ac22d23ad8675d9aad2f1df229b0c81e31cd (patch)
tree57f3346600cde955e45a4bb72a7224682bc57222 /test/io/console
parent7491541e1602d2cf9b29783abadf802f1f50251c (diff)
* 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/io/console')
-rw-r--r--test/io/console/test_io_console.rb15
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?)