mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
7a04666b3c
commit
d90ab4c09b
1 changed files with 8 additions and 0 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue