diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-28 17:46:18 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-28 17:46:18 +0000 |
commit | 23d10cbb00c726571183ad96dcd26547fd6200d8 (patch) | |
tree | af15dd10efae372bfc53ad43af23927872514b6a /test/ruby/test_econv.rb | |
parent | ad8cfb1b945d2ec6b28be8a1bc60ed458a19075c (diff) | |
download | ruby-23d10cbb00c726571183ad96dcd26547fd6200d8.tar.gz |
* transcode.c (econv_convert): new method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_econv.rb')
-rw-r--r-- | test/ruby/test_econv.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index 7d6e78227b..8f29fb9f31 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -559,4 +559,13 @@ class TestEncodingConverter < Test::Unit::TestCase assert_equal(:finished, ret) assert_equal(["xyzabc", ""], [dst, src]) end + + def test_convert + ec = Encoding::Converter.new("utf-8", "euc-jp") + assert_raise(Encoding::InvalidByteSequence) { ec.convert("a\x80") } + assert_raise(Encoding::ConversionUndefined) { ec.convert("\ufffd") } + ret = ec.primitive_convert(nil, "", nil, nil) + assert_equal(:finished, ret) + assert_raise(ArgumentError) { ec.convert("a") } + end end |