summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2025-06-20 18:28:08 +0900
committergit <[email protected]>2025-06-20 09:39:29 +0000
commitd9efc56c16267fabcfc764fd27cf4e464a231a76 (patch)
treea17ca57fa621143548d9571959e4f28a0943d35c /test
parent7addde1ece5f30cbd048175b8504feefbf7f8102 (diff)
[ruby/io-console] Ignore `^C` at interrupt
It's something we don't expect and might be coming from somewhere else. https://github.com/ruby/io-console/commit/f0646b2b6a
Diffstat (limited to 'test')
-rw-r--r--test/io/console/test_io_console.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index 519184c537..2ed04c287b 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -367,6 +367,7 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
w.print cc
w.flush
result = EnvUtil.timeout(3) {r.gets}
+ result = yield result if defined?(yield)
assert_equal(expect, result.chomp)
end
@@ -404,7 +405,7 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
if cc = ctrl["intr"]
assert_ctrl("#{cc.ord}", cc, r, w)
assert_ctrl("#{cc.ord}", cc, r, w)
- assert_ctrl("Interrupt", cc, r, w) unless /linux/ =~ RUBY_PLATFORM
+ assert_ctrl("Interrupt", cc, r, w) {|res| res.sub("^C", "")} unless /linux/ =~ RUBY_PLATFORM
end
if cc = ctrl["dsusp"]
assert_ctrl("#{cc.ord}", cc, r, w)