ruby-changes:5322
From: nobu <ko1@a...>
Date: Thu, 5 Jun 2008 10:59:00 +0900 (JST)
Subject: [ruby-changes:5322] Ruby:r16823 (trunk, ruby_1_8): * test/iconv/test_simple.rb: added.
nobu 2008-06-05 10:58:49 +0900 (Thu, 05 Jun 2008) New Revision: 16823 Added directories: branches/ruby_1_8/test/iconv/ trunk/test/iconv/ Added files: branches/ruby_1_8/test/iconv/test_simple.rb trunk/test/iconv/test_simple.rb Log: * test/iconv/test_simple.rb: added. Added: branches/ruby_1_8/test/iconv/ Added: trunk/test/iconv/ http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/iconv/test_simple.rb?revision=16823&view=markup http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/iconv/test_simple.rb?r1=16823&r2=16822&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/test/iconv/test_simple.rb?revision=16823&view=markup http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/test/iconv/test_simple.rb?r1=16823&r2=16822&diff_format=u Index: test/iconv/test_simple.rb =================================================================== --- test/iconv/test_simple.rb (revision 0) +++ test/iconv/test_simple.rb (revision 16823) @@ -0,0 +1,27 @@ +require 'test/unit' +begin + require 'iconv' +rescue LoadError +end + +class TestIConv < Test::Unit::TestCase + ASCII = "ascii" + def test_simple + c = Iconv.open(ASCII, ASCII) + ref = '[ruby-core:17092]' + rescue + return + else + assert_equal("abc", c.iconv("abc")) + assert_equal("c", c.iconv("abc", 2), "#{ref}: with start") + assert_equal("c", c.iconv("abc", 2, 1), "#{ref}: with start, length") + assert_equal("c", c.iconv("abc", 2, 5), "#{ref}: with start, longer length") + assert_equal("bc", c.iconv("abc", -2), "#{ref}: with nagative start") + assert_equal("b", c.iconv("abc", -2, 1), "#{ref}: with nagative start, length") + assert_equal("bc", c.iconv("abc", -2, 5), "#{ref}: with nagative start, longer length") + assert_equal("", c.iconv("abc", 5), "#{ref}: with OOB") + assert_equal("", c.iconv("abc", 5, 2), "#{ref}: with OOB, length") + ensure + c.close if c + end +end if defined?(::Iconv) Property changes on: test/iconv/test_simple.rb ___________________________________________________________________ Name: svn:eol-style + LF Index: ruby_1_8/test/iconv/test_simple.rb =================================================================== --- ruby_1_8/test/iconv/test_simple.rb (revision 0) +++ ruby_1_8/test/iconv/test_simple.rb (revision 16823) @@ -0,0 +1,27 @@ +require 'test/unit' +begin + require 'iconv' +rescue LoadError +end + +class TestIConv < Test::Unit::TestCase + ASCII = "ascii" + def test_simple + c = Iconv.open(ASCII, ASCII) + ref = '[ruby-core:17092]' + rescue + return + else + assert_equal("abc", c.iconv("abc")) + assert_equal("c", c.iconv("abc", 2), "#{ref}: with start") + assert_equal("c", c.iconv("abc", 2, 1), "#{ref}: with start, length") + assert_equal("c", c.iconv("abc", 2, 5), "#{ref}: with start, longer length") + assert_equal("bc", c.iconv("abc", -2), "#{ref}: with nagative start") + assert_equal("b", c.iconv("abc", -2, 1), "#{ref}: with nagative start, length") + assert_equal("bc", c.iconv("abc", -2, 5), "#{ref}: with nagative start, longer length") + assert_equal("", c.iconv("abc", 5), "#{ref}: with OOB") + assert_equal("", c.iconv("abc", 5, 2), "#{ref}: with OOB, length") + ensure + c.close if c + end +end if defined?(::Iconv) Property changes on: ruby_1_8/test/iconv/test_simple.rb ___________________________________________________________________ Name: svn:eol-style + LF -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/