From 528b75cc14f76ef703f0b22ccdd6db4b398982cc Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 27 Jun 2025 16:22:56 +0900 Subject: [PATCH] [ruby/io-console] Ignore printed control char It's something we don't expect and might be coming from somewhere else. https://github.com/ruby/io-console/commit/c5e47a900c --- test/io/console/test_io_console.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index deeedf01f3..cdaa255426 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -367,6 +367,15 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do w.print cc w.flush result = EnvUtil.timeout(3) {r.gets} + if res + case cc + when 0..31 + cc = "^" + (cc.ord | 0x40).chr + when 127 + cc = "^?" + end + res.sub!(cc, "") + end assert_equal(expect, result.chomp) end