[前][次][番号順一覧][スレッド一覧]

ruby-changes:62727

From: Leam <ko1@a...>
Date: Thu, 27 Aug 2020 23:46:48 +0900 (JST)
Subject: [ruby-changes:62727] f4b9e94317 (master): [ruby/io-console] Bug 17128: In test_set_winsize_console, wrapped re-size in a begin-rescue-else.

https://git.ruby-lang.org/ruby.git/commit/?id=f4b9e94317

From f4b9e94317853d3389c34fda35eba72face72a7b Mon Sep 17 00:00:00 2001
From: Leam Hall <leamhall@g...>
Date: Fri, 21 Aug 2020 12:10:54 -0400
Subject: [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

diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index 66721b1..3613a2c 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -443,10 +443,14 @@ defined?(IO.console) and TestIO_Console.class_eval do https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L443
       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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]