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

[ruby/irb] Suppress sequence to inspect asian ambiguous width

https://github.com/ruby/irb/commit/a7097c5b80
This commit is contained in:
Nobuyoshi Nakada 2022-10-28 16:35:00 +09:00 committed by git
parent 7440fc3eb4
commit 13e968c1cd

View file

@ -113,7 +113,17 @@ module TestIRB
East\sAsian\sAmbiguous\sWidth:\s\d\n East\sAsian\sAmbiguous\sWidth:\s\d\n
#{@is_win ? 'Code\spage:\s\d+\n' : ''} #{@is_win ? 'Code\spage:\s\d+\n' : ''}
}x }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 ensure
ENV["LANG"] = lang_backup ENV["LANG"] = lang_backup
ENV["LC_ALL"] = lc_all_backup ENV["LC_ALL"] = lc_all_backup