diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-12 23:03:46 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-12 23:03:46 +0000 |
commit | 5501d84ceb8ca479d06197d196989d41b39c61ee (patch) | |
tree | 230b2fe7acd7bff8f01d1fc01a0fb9f168ef6b8d /test/ruby/test_econv.rb | |
parent | 9d4bb3b969799e314197c70b3e33223564258bc8 (diff) | |
download | ruby-5501d84ceb8ca479d06197d196989d41b39c61ee.tar.gz |
* transcode.c (econv_primitive_convert): add output_size argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_econv.rb')
-rw-r--r-- | test/ruby/test_econv.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index 4bae60a877..a4f86d1c93 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -7,7 +7,7 @@ class TestEncodingConverter < Test::Unit::TestCase ec = Encoding::Converter.new(from, to) dst = '' while true - ret = ec.primitive_convert(src, dst2=" "*opt[:obuf_len], 0) + ret = ec.primitive_convert(src, dst2="", opt[:obuf_len], 0) dst << dst2 #p [ret, dst, src] break if ret != :obuf_full @@ -37,15 +37,15 @@ class TestEncodingConverter < Test::Unit::TestCase def test_errors ec = Encoding::Converter.new("UTF-16BE", "EUC-JP") src = "\xFF\xFE\x00A\xDC\x00" - ret = ec.primitive_convert(src, dst=" "*10, 0) + ret = ec.primitive_convert(src, dst="", 10, 0) assert_equal("", src) assert_equal("", dst) - assert_equal(:undefined_conversion, ret) - ret = ec.primitive_convert(src, dst=" "*10, 0) + assert_equal(:undefined_conversion, ret) # \xFF\xFE is not representable in EUC-JP + ret = ec.primitive_convert(src, dst="", 10, 0) assert_equal("", src) assert_equal("A", dst) - assert_equal(:invalid_input, ret) - ret = ec.primitive_convert(src, dst=" "*10, 0) + assert_equal(:invalid_input, ret) # \xDC\x00 is invalid as UTF-16BE + ret = ec.primitive_convert(src, dst="", 10, 0) assert_equal("", src) assert_equal("", dst) assert_equal(:finished, ret) |