diff options
Diffstat (limited to 'test/ruby/test_econv.rb')
-rw-r--r-- | test/ruby/test_econv.rb | 10 |
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] |