-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Internal encoding can only be UTF-8.
- Loading branch information
Showing
74 changed files
with
267 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
describe "ruby -E" do | ||
it "raises a RuntimeError if used with -U" do | ||
ruby_exe("p 1", | ||
:options => '-Eascii:ascii -U', | ||
:args => '2>&1').should =~ /RuntimeError/ | ||
ruby_exe('', :options => '-Eascii:ascii -U', :args => '2>&1').should == \ | ||
"The -E option setting internal encoding is deprecated. Rubinius internal encoding is always UTF-8\nThe -U option is deprecated. Rubinius internal encoding is always UTF-8\n" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,6 @@ | ||
describe 'The -K command line option sets __ENCODING__' do | ||
it "to Encoding::ASCII_8BIT with -Ka" do | ||
ruby_exe("print __ENCODING__", :options => '-Ka').should == Encoding::ASCII_8BIT.to_s | ||
end | ||
|
||
it "to Encoding::ASCII_8BIT with -KA" do | ||
ruby_exe("print __ENCODING__", :options => '-KA').should == Encoding::ASCII_8BIT.to_s | ||
end | ||
|
||
it "to Encoding::EUC_JP with -Ke" do | ||
ruby_exe("print __ENCODING__", :options => '-Ke').should == Encoding::EUC_JP.to_s | ||
end | ||
|
||
it "to Encoding::EUC_JP with -KE" do | ||
ruby_exe("print __ENCODING__", :options => '-KE').should == Encoding::EUC_JP.to_s | ||
end | ||
|
||
it "to Encoding::UTF_8 with -Ku" do | ||
ruby_exe("print __ENCODING__", :options => '-Ku').should == Encoding::UTF_8.to_s | ||
end | ||
|
||
it "to Encoding::UTF_8 with -KU" do | ||
ruby_exe("print __ENCODING__", :options => '-KU').should == Encoding::UTF_8.to_s | ||
end | ||
|
||
it "to Encoding::Windows_31J with -Ks" do | ||
ruby_exe("print __ENCODING__", :options => '-Ks').should == Encoding::Windows_31J.to_s | ||
end | ||
|
||
it "to Encoding::Windows_31J with -KS" do | ||
ruby_exe("print __ENCODING__", :options => '-KS').should == Encoding::Windows_31J.to_s | ||
it "warns that -K is deprecated" do | ||
ruby_exe('', :options => '-K', :args => '2>&1').should == \ | ||
"The -K option is deprecated. Rubinius internal encoding is always UTF-8\n" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,6 @@ | ||
describe "ruby -U" do | ||
it "sets Encoding.default_internal to UTF-8" do | ||
ruby_exe('print Encoding.default_internal.name', | ||
:options => '-U').should == 'UTF-8' | ||
end | ||
|
||
it "does nothing different if specified multiple times" do | ||
ruby_exe('print Encoding.default_internal.name', | ||
:options => '-U -U').should == 'UTF-8' | ||
end | ||
|
||
it "is overruled by Encoding.default_internal=" do | ||
ruby_exe('Encoding.default_internal="ascii"; print Encoding.default_internal.name', | ||
:options => '-U').should == 'US-ASCII' | ||
end | ||
|
||
it "does not affect the default external encoding" do | ||
ruby_exe('Encoding.default_external="ascii"; print Encoding.default_external.name', | ||
:options => '-U').should == 'US-ASCII' | ||
end | ||
|
||
it "does not affect the source encoding" do | ||
ruby_exe("print __ENCODING__.name", | ||
:options => '-U -KE').should == 'EUC-JP' | ||
ruby_exe("print __ENCODING__.name", | ||
:options => '-KE -U').should == 'EUC-JP' | ||
end | ||
|
||
# I assume IO redirection will break on Windows... | ||
it "raises a RuntimeError if used with -Eext:int" do | ||
ruby_exe("p 1", | ||
:options => '-U -Eascii:ascii', | ||
:args => '2>&1').should =~ /RuntimeError/ | ||
end | ||
|
||
it "raises a RuntimeError if used with -E:int" do | ||
ruby_exe("p 1", | ||
:options => '-U -E:ascii', | ||
:args => '2>&1').should =~ /RuntimeError/ | ||
it "warns that -U is deprecated" do | ||
ruby_exe('', :options => '-U', :args => '2>&1').should == \ | ||
"The -U option is deprecated. Rubinius internal encoding is always UTF-8\n" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.