summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_econv.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-31 05:18:29 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-31 05:18:29 +0000
commit25ac0a9d8556dd8c9243172eb5ef32f87883c0e4 (patch)
tree822ba431b28a7d5d79ef9b88b993e73d21cdf129 /test/ruby/test_econv.rb
parente8a30cef4040bde984e19fe52b6a1bb2ffa47a89 (diff)
downloadruby-25ac0a9d8556dd8c9243172eb5ef32f87883c0e4.tar.gz
ruby-25ac0a9d8556dd8c9243172eb5ef32f87883c0e4.tar.xz
ruby-25ac0a9d8556dd8c9243172eb5ef32f87883c0e4.zip
* transcode.c (econv_primitive_convert): make two arguments,
destination_byteoffset and destination_bytesize, optional. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_econv.rb')
-rw-r--r--test/ruby/test_econv.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb
index 52e8b97b4..b1052dfc2 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