summaryrefslogtreecommitdiff
path: root/test/io/console
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-08-18 12:19:25 +0900
committergit <svn-admin@ruby-lang.org>2023-08-18 03:55:04 +0000
commit818ba30ee9e188c59385a56bc7560f43e90bce94 (patch)
tree5a87a6d1aa24eb4cdff1d95a69a79079470c961c /test/io/console
parentcff8058701641c680de4924ea98d1b9d0efd9244 (diff)
[ruby/io-console] Avoid the influence of special variable `$/`
https://github.com/ruby/io-console/commit/5f71354332
Diffstat (limited to 'test/io/console')
-rw-r--r--test/io/console/test_io_console.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index 972b2e4cb4..fd0e57b8a5 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -258,6 +258,15 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
assert_equal("\r\n", r.gets)
assert_equal("\"asdf\"", r.gets.chomp)
end
+
+ run_pty("$VERBOSE, $/ = nil, '.'; p IO.console.getpass('> ')") do |r, w|
+ assert_equal("> ", r.readpartial(10))
+ sleep 0.1
+ w.print "asdf\n"
+ sleep 0.1
+ assert_equal("\r\n", r.gets)
+ assert_equal("\"asdf\"", r.gets.chomp)
+ end
end
def test_iflush