зеркало из https://github.com/github/ruby.git
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
7a04666b3c
Коммит
d90ab4c09b
|
@ -36,6 +36,14 @@ class TestEncodingConverter < Test::Unit::TestCase
|
|||
assert_nil(Encoding::Converter.stateless_encoding(Encoding::UTF_8))
|
||||
end
|
||||
|
||||
def test_stateless_encoding_iso2022jp
|
||||
slenc = Encoding::Converter.stateless_encoding("ISO-2022-JP")
|
||||
str = "\e$B~~\(B".force_encoding("iso-2022-jp")
|
||||
str2 = str.encode(slenc)
|
||||
str3 = str.encode("ISO-2022-JP")
|
||||
assert_equal(str, str3)
|
||||
end
|
||||
|
||||
def test_new
|
||||
assert_kind_of(Encoding::Converter, Encoding::Converter.new("UTF-8", "EUC-JP"))
|
||||
assert_kind_of(Encoding::Converter, Encoding::Converter.new(Encoding::UTF_8, Encoding::EUC_JP))
|
||||
|
|
Загрузка…
Ссылка в новой задаче