Skip to content

Commit

Permalink
Bug 17128: In test_set_winsize_console, wrapped re-size in a begin-re…
Browse files Browse the repository at this point in the history
…scue-else.
  • Loading branch information
LeamHall authored and nobu committed Aug 25, 2020
1 parent a4e0a1d commit a22333c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/io/console/test_io_console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,14 @@ def test_set_winsize_console
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
Expand Down

0 comments on commit a22333c

Please sign in to comment.