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

ruby-changes:74278

From: Nobuyoshi <ko1@a...>
Date: Fri, 28 Oct 2022 17:29:57 +0900 (JST)
Subject: [ruby-changes:74278] 13e968c1cd (master): [ruby/irb] Suppress sequence to inspect asian ambiguous width

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

From 13e968c1cdd2da470173e2cc15b44ebb936be534 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 28 Oct 2022 16:35:00 +0900
Subject: [ruby/irb] Suppress sequence to inspect asian ambiguous width

https://github.com/ruby/irb/commit/a7097c5b80
---
 test/irb/test_cmd.rb | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb
index e330aa3a44..060f70c9cc 100644
--- a/test/irb/test_cmd.rb
+++ b/test/irb/test_cmd.rb
@@ -113,7 +113,17 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_cmd.rb#L113
         East\sAsian\sAmbiguous\sWidth:\s\d\n
         #{@is_win ? 'Code\spage:\s\d+\n' : ''}
       }x
-      assert_match expected, irb.context.main.irb_info.to_s
+      info = irb.context.main.irb_info
+      capture_output do
+        # Reline::Core#ambiguous_width may access STDOUT, not $stdout
+        stdout = STDOUT.dup
+        STDOUT.reopen(IO::NULL, "w")
+        info = info.to_s
+      ensure
+        STDOUT.reopen(stdout)
+        stdout.close
+      end
+      assert_match expected, info
     ensure
       ENV["LANG"] = lang_backup
       ENV["LC_ALL"] = lc_all_backup
-- 
cgit v1.2.3


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

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