aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_econv.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-14 10:38:41 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-14 10:38:41 +0000
commit7db5e184c20a2a692a97b6308221d2212a290056 (patch)
tree1712248ec37b076d12be00dc1cfc383368c6d3be /test/ruby/test_econv.rb
parentb299bd606b8b927ea6087f9dffc2adbabea826c9 (diff)
downloadruby-7db5e184c20a2a692a97b6308221d2212a290056.tar.gz
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_econv.rb')
-rw-r--r--test/ruby/test_econv.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb
index 860261d24f..ba8d6d9b94 100644
--- a/test/ruby/test_econv.rb
+++ b/test/ruby/test_econv.rb
@@ -20,7 +20,7 @@ class TestEncodingConverter < Test::Unit::TestCase
[o, ret, i])
end
- def test_output_area
+ def test_output_region
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
ec.primitive_convert(src="a", dst="b", nil, 1, Encoding::Converter::PARTIAL_INPUT)
assert_equal("ba", dst)
@@ -39,6 +39,14 @@ class TestEncodingConverter < Test::Unit::TestCase
}
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)
+ assert_equal(:ibuf_empty, ret)
+ ret = ec.primitive_convert(src="", dst="", nil, 10)
+ assert_equal(:finished, ret)
+ end
+
def test_accumulate_dst1
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
a = ["", "abc\u{3042}def", ec, nil, 1]