1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/io-console] Bug 17128: In test_set_winsize_console, wrapped re-size in a begin-rescue-else.

https://github.com/ruby/io-console/commit/a22333c33a
This commit is contained in:
Leam Hall 2020-08-21 12:10:54 -04:00 committed by Nobuyoshi Nakada
parent b3c1c767ea
commit f4b9e94317
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -443,10 +443,14 @@ defined?(IO.console) and TestIO_Console.class_eval do
s = IO.console.winsize
assert_nothing_raised(TypeError) {IO.console.winsize = s}
bug = '[ruby-core:82741] [Bug #13888]'
IO.console.winsize = [s[0], s[1]+1]
assert_equal([s[0], s[1]+1], IO.console.winsize, bug)
IO.console.winsize = s
assert_equal(s, IO.console.winsize, bug)
begin
IO.console.winsize = [s[0], s[1]+1]
assert_equal([s[0], s[1]+1], IO.console.winsize, bug)
rescue Errno::EINVAL # Error if run on an actual console.
else
IO.console.winsize = s
assert_equal(s, IO.console.winsize, bug)
end
ensure
set_winsize_teardown
end