mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
a11fa7d8cd
commit
022268ae00
1 changed files with 16 additions and 5 deletions
|
@ -7,11 +7,13 @@ describe "Encoding.locale_charmap" do
|
||||||
|
|
||||||
# FIXME: Get this working on Windows
|
# FIXME: Get this working on Windows
|
||||||
platform_is :linux do
|
platform_is :linux do
|
||||||
it "returns a value based on the LC_ALL environment variable" do
|
platform_is_not :android do
|
||||||
old_lc_all = ENV['LC_ALL']
|
it "returns a value based on the LC_ALL environment variable" do
|
||||||
ENV['LC_ALL'] = 'C'
|
old_lc_all = ENV['LC_ALL']
|
||||||
ruby_exe("print Encoding.locale_charmap").should == 'ANSI_X3.4-1968'
|
ENV['LC_ALL'] = 'C'
|
||||||
ENV['LC_ALL'] = old_lc_all
|
ruby_exe("print Encoding.locale_charmap").should == 'ANSI_X3.4-1968'
|
||||||
|
ENV['LC_ALL'] = old_lc_all
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -33,6 +35,15 @@ describe "Encoding.locale_charmap" do
|
||||||
end
|
end
|
||||||
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
|
platform_is :bsd, :darwin, :linux do
|
||||||
it "is unaffected by assigning to ENV['LC_ALL'] in the same process" do
|
it "is unaffected by assigning to ENV['LC_ALL'] in the same process" do
|
||||||
old_charmap = Encoding.locale_charmap
|
old_charmap = Encoding.locale_charmap
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue