diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-31 05:18:29 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-31 05:18:29 +0000 |
commit | 9d2accff2b2424a00b7a397711fcddf206f18cee (patch) | |
tree | 822ba431b28a7d5d79ef9b88b993e73d21cdf129 /test/ruby/test_econv.rb | |
parent | f3c43ae0c2d7ceb7d219a35e956600e0db6ebcab (diff) | |
download | ruby-9d2accff2b2424a00b7a397711fcddf206f18cee.tar.gz |
* transcode.c (econv_primitive_convert): make two arguments,
destination_byteoffset and destination_bytesize, optional.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_econv.rb')
-rw-r--r-- | test/ruby/test_econv.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index 52e8b97b4f..b1052dfc21 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -93,7 +93,16 @@ class TestEncodingConverter < Test::Unit::TestCase assert_equal("\xEF\xBD\xA1".force_encoding("UTF-8") * n, dst) end - def test_nil_destination_bytesize_with_nonnli_byteoffset + def test_nil_destination_bytesize2 + ec = Encoding::Converter.new("Shift_JIS", "UTF-8") + n = 10000 + src = "\xa1".force_encoding("Shift_JIS") * n + ret = ec.primitive_convert(src, dst="") + assert_equal(:finished, ret) + assert_equal("\xEF\xBD\xA1".force_encoding("UTF-8") * n, dst) + end + + def test_nil_destination_bytesize_with_nonnil_byteoffset ec = Encoding::Converter.new("Shift_JIS", "UTF-8") n = 2000 src = "\xa1".force_encoding("Shift_JIS") * n |