diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-12 13:53:42 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-12 13:53:42 +0000 |
commit | 2d80b1695d9f7b6fbe99f63117078033ac40ebb2 (patch) | |
tree | 1bebadb8d4bc02dcb1b5bf6553ad8f314195c739 /test/ruby | |
parent | 89a5c998c7297f9f565e434dfae8d03765e3c393 (diff) | |
download | ruby-2d80b1695d9f7b6fbe99f63117078033ac40ebb2.tar.gz |
* transcode.c (decorator_names): extracted from rb_econv_open.
(rb_econv_open): use decorator_names.
(econv_args): extracted from econv_init.
(econv_init): use econv_args.
(decorate_convpath): new function.
(search_convpath_i): new function.
(econv_s_search_convpath): new method.
(Init_transcode): new method defined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_econv.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index 73e6e0ffb8..68175fe67e 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -816,6 +816,7 @@ class TestEncodingConverter < Test::Unit::TestCase iso88591 = Encoding::ISO_8859_1 iso2022jp = Encoding::ISO_2022_JP siso2022jp = Encoding::STATELESS_ISO_2022_JP + assert_equal([], Encoding::Converter.new("", "").convpath) assert_equal([[eucjp, utf8], [utf8, iso88591]], Encoding::Converter.new(eucjp, iso88591).convpath) @@ -833,4 +834,19 @@ class TestEncodingConverter < Test::Unit::TestCase assert_equal([[utf16be, utf8], "universal_newline", [utf8, utf16le]], Encoding::Converter.new(utf16be, utf16le, universal_newline: true).convpath) end + + def test_search_convpath + eucjp = Encoding::EUC_JP + utf8 = Encoding::UTF_8 + utf32be = Encoding::UTF_32BE + iso88591 = Encoding::ISO_8859_1 + assert_equal([[iso88591,utf8], [utf8,eucjp]], + Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP")) + assert_equal([[iso88591,utf8], [utf8,eucjp]], + Encoding::Converter.search_convpath(iso88591, eucjp)) + assert_equal([[iso88591,utf8], [utf8,eucjp], "universal_newline"], + Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP", universal_newline: true)) + assert_equal([[iso88591,utf8], "universal_newline", [utf8,utf32be]], + Encoding::Converter.search_convpath("ISO-8859-1", "UTF-32BE", universal_newline: true)) + end end |