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

[ruby/irb] Add East Asian Ambiguous Width to irb_info command

https://github.com/ruby/irb/commit/4cade4b7e5
This commit is contained in:
aycabta 2021-12-20 16:06:12 +09:00 committed by git
parent 145f7c094f
commit b96ef7684c
2 changed files with 6 additions and 0 deletions

View file

@ -16,6 +16,7 @@ module IRB
str += "RUBY_PLATFORM: #{RUBY_PLATFORM}\n"
str += "LANG env: #{ENV["LANG"]}\n" if ENV["LANG"] && !ENV["LANG"].empty?
str += "LC_ALL env: #{ENV["LC_ALL"]}\n" if ENV["LC_ALL"] && !ENV["LC_ALL"].empty?
str += "East Asian Ambiguous Width: #{Reline.ambiguous_width.inspect}\n"
if RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
codepage = `chcp`.sub(/.*: (\d+)\n/, '\1')
str += "Code page: #{codepage}\n"

View file

@ -81,6 +81,7 @@ module TestIRB
InputMethod:\sAbstract\sInputMethod\n
\.irbrc\spath:\s.+\n
RUBY_PLATFORM:\s.+\n
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
@ -107,6 +108,7 @@ module TestIRB
InputMethod:\sAbstract\sInputMethod\n
\.irbrc\spath:\s.+\n
RUBY_PLATFORM:\s.+\n
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
@ -135,6 +137,7 @@ module TestIRB
IRB\sversion:\sirb\s.+\n
InputMethod:\sAbstract\sInputMethod\n
RUBY_PLATFORM:\s.+\n
East\sAsian\sAmbiguous\sWidth:\s\d\n
#{@is_win ? 'Code\spage:\s\d+\n' : ''}
\z
}x
@ -167,6 +170,7 @@ module TestIRB
IRB\sversion:\sirb\s.+\n
InputMethod:\sAbstract\sInputMethod\n
RUBY_PLATFORM:\s.+\n
East\sAsian\sAmbiguous\sWidth:\s\d\n
#{@is_win ? 'Code\spage:\s\d+\n' : ''}
\z
}x
@ -201,6 +205,7 @@ module TestIRB
RUBY_PLATFORM: .+\n
LANG\senv:\sja_JP\.UTF-8\n
LC_ALL\s env:\sen_US\.UTF-8\n
East\sAsian\sAmbiguous\sWidth:\s\d\n
}x
assert_match expected, irb.context.main.irb_info.to_s
ensure