зеркало из https://github.com/github/ruby.git
spec/ruby/core/encoding/locale_charmap_spec.rb: locale_charmap is UTF-8 on Android
nl_langinfo(CODESET) always returns UTF-8 on Android, regardless to LC_ALL=C.
This commit is contained in:
Родитель
a11fa7d8cd
Коммит
022268ae00
|
@ -7,6 +7,7 @@ describe "Encoding.locale_charmap" do
|
|||
|
||||
# FIXME: Get this working on Windows
|
||||
platform_is :linux do
|
||||
platform_is_not :android do
|
||||
it "returns a value based on the LC_ALL environment variable" do
|
||||
old_lc_all = ENV['LC_ALL']
|
||||
ENV['LC_ALL'] = 'C'
|
||||
|
@ -14,6 +15,7 @@ describe "Encoding.locale_charmap" do
|
|||
ENV['LC_ALL'] = old_lc_all
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
platform_is :freebsd, :openbsd, :darwin do
|
||||
it "returns a value based on the LC_ALL environment variable" do
|
||||
|
@ -33,6 +35,15 @@ describe "Encoding.locale_charmap" do
|
|||
end
|
||||
end
|
||||
|
||||
platform_is :android do
|
||||
it "always returns UTF-8" do
|
||||
old_lc_all = ENV['LC_ALL']
|
||||
ENV['LC_ALL'] = 'C'
|
||||
ruby_exe("print Encoding.locale_charmap").should == 'UTF-8'
|
||||
ENV['LC_ALL'] = old_lc_all
|
||||
end
|
||||
end
|
||||
|
||||
platform_is :bsd, :darwin, :linux do
|
||||
it "is unaffected by assigning to ENV['LC_ALL'] in the same process" do
|
||||
old_charmap = Encoding.locale_charmap
|
||||
|
|
Загрузка…
Ссылка в новой задаче