summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_econv.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-28 17:13:49 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-28 17:13:49 +0000
commit801e8eb5b9278d814cbe3b20762887e8340cc613 (patch)
treea4b78cdd67db724a935501dd5473e7cd94fa6348 /test/ruby/test_econv.rb
parent642ea67a0162c002a1dc7ab6b10b944e61f0b3d3 (diff)
downloadruby-801e8eb5b9278d814cbe3b20762887e8340cc613.tar.gz
ruby-801e8eb5b9278d814cbe3b20762887e8340cc613.tar.xz
ruby-801e8eb5b9278d814cbe3b20762887e8340cc613.zip
* transcode.c (econv_primitive_convert): accept nil as input for empty
input. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_econv.rb')
-rw-r--r--test/ruby/test_econv.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb
index 5324e6dfe..bc22da567 100644
--- a/test/ruby/test_econv.rb
+++ b/test/ruby/test_econv.rb
@@ -79,6 +79,12 @@ class TestEncodingConverter < Test::Unit::TestCase
}
end
+ def test_nil_input
+ ec = Encoding::Converter.new("UTF-8", "EUC-JP")
+ ret = ec.primitive_convert(nil, dst="", nil, 10)
+ assert_equal(:finished, ret)
+ end
+
def test_partial_input
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
ret = ec.primitive_convert(src="", dst="", nil, 10, Encoding::Converter::PARTIAL_INPUT)