From 25ac0a9d8556dd8c9243172eb5ef32f87883c0e4 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 31 Aug 2008 05:18:29 +0000 Subject: * 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 --- test/ruby/test_econv.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test/ruby') 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 -- cgit