diff options
author | Nobuyoshi Nakada <[email protected]> | 2025-07-01 17:24:02 +0900 |
---|---|---|
committer | git <[email protected]> | 2025-07-01 08:36:19 +0000 |
commit | d3d249b9048b338535ae033acb3606abf174b2da (patch) | |
tree | edcc7e85e5aeb8c6829ea367b95a7f5a346b5549 | |
parent | 06f9fc20ec1d41bce7cbac14c5f8b977dfc479d3 (diff) |
[ruby/io-console] Fix removing unexpected control chars
`cc` is created as `"\C-x"`, it is a String since ruby 1.9.
https://github.com/ruby/io-console/commit/65c9266feb
-rw-r--r-- | test/io/console/test_io_console.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 59fe01879b..c3f9c91c7d 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -373,10 +373,10 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do w.flush result = EnvUtil.timeout(3) {r.gets} if result - case cc - when 0..31 + case cc.chr + when "\C-A".."\C-_" cc = "^" + (cc.ord | 0x40).chr - when 127 + when "\C-?" cc = "^?" end result.sub!(cc, "") |