ruby-changes:7098
From: akr <ko1@a...>
Date: Thu, 14 Aug 2008 19:40:20 +0900 (JST)
Subject: [ruby-changes:7098] Ruby:r18616 (trunk): add a test.
akr 2008-08-14 19:38:41 +0900 (Thu, 14 Aug 2008) New Revision: 18616 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18616 Log: add a test. Modified files: trunk/test/ruby/test_econv.rb Index: test/ruby/test_econv.rb =================================================================== --- test/ruby/test_econv.rb (revision 18615) +++ test/ruby/test_econv.rb (revision 18616) @@ -20,7 +20,7 @@ [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 @@ } 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] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/