aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-12-20 16:06:12 +0900
committergit <svn-admin@ruby-lang.org>2021-12-20 16:19:36 +0900
commitb96ef7684c45ea1959c6f2bdad125b4a073419a4 (patch)
treed0b2ed9300be02e8323d33090af66ecaa4ae8788
parent145f7c094f4eb25d7fe39b60276222109afad1d1 (diff)
downloadruby-b96ef7684c45ea1959c6f2bdad125b4a073419a4.tar.gz
[ruby/irb] Add East Asian Ambiguous Width to irb_info command
https://github.com/ruby/irb/commit/4cade4b7e5
-rw-r--r--lib/irb/cmd/info.rb1
-rw-r--r--test/irb/test_cmd.rb5
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/irb/cmd/info.rb b/lib/irb/cmd/info.rb
index 8ad0c2a438..a2f2a27cec 100644
--- a/lib/irb/cmd/info.rb
+++ b/lib/irb/cmd/info.rb
@@ -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"
diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb
index 8eee36badc..07c0acfe6d 100644
--- a/test/irb/test_cmd.rb
+++ b/test/irb/test_cmd.rb
@@ -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