mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b299bd606b
commit
7db5e184c2
1 changed files with 9 additions and 1 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue