Skip to content

Commit a7097c5

Browse files
committed
Suppress sequence to inspect asian ambiguous width
1 parent 565eeb3 commit a7097c5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/irb/test_cmd.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,17 @@ def test_irb_info_singleline
113113
East\sAsian\sAmbiguous\sWidth:\s\d\n
114114
#{@is_win ? 'Code\spage:\s\d+\n' : ''}
115115
}x
116-
assert_match expected, irb.context.main.irb_info.to_s
116+
info = irb.context.main.irb_info
117+
capture_output do
118+
# Reline::Core#ambiguous_width may access STDOUT, not $stdout
119+
stdout = STDOUT.dup
120+
STDOUT.reopen(IO::NULL, "w")
121+
info = info.to_s
122+
ensure
123+
STDOUT.reopen(stdout)
124+
stdout.close
125+
end
126+
assert_match expected, info
117127
ensure
118128
ENV["LANG"] = lang_backup
119129
ENV["LC_ALL"] = lc_all_backup

0 commit comments

Comments
 (0)