Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions test/io/console/test_io_console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
end

class TestIO_Console < Test::Unit::TestCase
HOST_OS = RbConfig::CONFIG['host_os']
private def host_os?(os)
HOST_OS =~ os
end

begin
PATHS = $LOADED_FEATURES.grep(%r"/io/console(?:\.#{RbConfig::CONFIG['DLEXT']}|\.rb|/\w+\.rb)\z") {$`}
rescue Encoding::CompatibilityError
Expand All @@ -26,7 +31,7 @@ class TestIO_Console < Test::Unit::TestCase
# But it does not occur in `make test-all > /dev/null`, so
# there should be an additional factor, I guess.
def set_winsize_setup
@old_ttou = trap(:TTOU, 'IGNORE') if RUBY_PLATFORM =~ /freebsd/i
@old_ttou = trap(:TTOU, 'IGNORE') if host_os?(/freebsd/)
end

def set_winsize_teardown
Expand Down Expand Up @@ -387,7 +392,7 @@ def test_intr
# TestIO_Console#test_intr [/usr/home/chkbuild/chkbuild/tmp/build/20220304T163001Z/ruby/test/io/console/test_io_console.rb:387]:
# <"25"> expected but was
# <"-e:12:in `p': \e[1mexecution expired (\e[1;4mTimeout::Error\e[m\e[1m)\e[m">.
omit if /freebsd/ =~ RUBY_PLATFORM
omit if host_os?(/freebsd/)

run_pty("#{<<~"begin;"}\n#{<<~'end;'}") do |r, w, _|
begin;
Expand All @@ -413,7 +418,7 @@ def test_intr
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) unless host_os?(/linux/)
end
if cc = ctrl["dsusp"]
assert_ctrl("#{cc.ord}", cc, r, w)
Expand Down