From 0afb3e381d0e7f769d2be2fadba117be1317060c Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 29 Oct 2009 19:28:49 +0000 Subject: [PATCH] * test/ruby/enc/test_gb18030.rb (test_left_adjust_char_head): String#chop no longer raises ArgumentError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/enc/test_gb18030.rb | 53 ++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/test/ruby/enc/test_gb18030.rb b/test/ruby/enc/test_gb18030.rb index a33a9eb28e..f379504d48 100644 --- a/test/ruby/enc/test_gb18030.rb +++ b/test/ruby/enc/test_gb18030.rb @@ -28,7 +28,8 @@ class TestGB18030 < Test::Unit::TestCase end def fcheck(c) - assert_raise(ArgumentError) { s(c.reverse.join).chop } + c = s(c.reverse.join) + assert_raise(ArgumentError, c) { c.chop } end def test_left_adjust_char_head @@ -84,42 +85,42 @@ class TestGB18030 < Test::Unit::TestCase scheck([c4], 1) scheck([c4, c1], 1) scheck([c4, cm], 2) - fcheck([c4, cm, c1]) - fcheck([c4, cm, c4, c1]) + scheck([c4, cm, c1], 2) + scheck([c4, cm, c4, c1], 2) scheck([c4, cm, c4, cm], 4) scheck([c4, cm, c4, cm, c1], 4) scheck([c4, cm, c4, cm, c4], 4) scheck([c4, cm, c4, cm, c4, c1], 4) - fcheck([c4, cm, c4, cm, c4, cm]) - fcheck([c4, cm, c4, cm, c4, cm, c1]) - fcheck([c4, cm, c4, cm, c4, cm, c4]) + scheck([c4, cm, c4, cm, c4, cm], 2) + scheck([c4, cm, c4, cm, c4, cm, c1], 2) + scheck([c4, cm, c4, cm, c4, cm, c4], 2) scheck([c4, cm, c4, cm, c4, cm, cm, c1], 4) - fcheck([c4, cm, c4, cm, c4, cm, cm, cm]) - fcheck([c4, cm, c4, cm, c4, cm, cm, cm, c1]) + scheck([c4, cm, c4, cm, c4, cm, cm, cm], 2) + scheck([c4, cm, c4, cm, c4, cm, cm, cm, c1], 2) scheck([c4, cm, c4, cm, c4, cm, cm, cm, cm], 4) - fcheck([c4, cm, c4, cm, cm, c1]) + scheck([c4, cm, c4, cm, cm, c1], 2) scheck([c4, cm, c4, cm, cm, cm], 4) scheck([c4, cm, c4, cm, cm, cm, c1], 4) - fcheck([c4, cm, c4, cm, cm, cm, cm]) + scheck([c4, cm, c4, cm, cm, cm, cm], 2) scheck([c4, cm, cm], 1) scheck([cm], 1) - fcheck([cm, c1]) - fcheck([cm, c4, c1]) + scheck([cm, c1], 1) + scheck([cm, c4, c1], 1) scheck([cm, c4, cm], 3) - fcheck([cm, c4, cm, c1]) - fcheck([cm, c4, cm, c4]) - fcheck([cm, c4, cm, c4, c1]) - fcheck([cm, c4, cm, c4, cm]) - fcheck([cm, c4, cm, c4, cm, c1]) - fcheck([cm, c4, cm, c4, cm, c4]) - fcheck([cm, c4, cm, c4, cm, cm, c1]) - fcheck([cm, c4, cm, c4, cm, cm, cm]) - fcheck([cm, c4, cm, c4, cm, cm, cm, c1]) - fcheck([cm, c4, cm, c4, cm, cm, cm, cm]) - fcheck([cm, c4, cm, cm, c1]) - fcheck([cm, c4, cm, cm, cm]) - fcheck([cm, c4, cm, cm, cm, c1]) - fcheck([cm, c4, cm, cm, cm, cm]) + scheck([cm, c4, cm, c1], 3) + scheck([cm, c4, cm, c4], 3) + scheck([cm, c4, cm, c4, c1], 3) + scheck([cm, c4, cm, c4, cm], 1) + scheck([cm, c4, cm, c4, cm, c1], 1) + scheck([cm, c4, cm, c4, cm, c4], 1) + scheck([cm, c4, cm, c4, cm, cm, c1], 3) + scheck([cm, c4, cm, c4, cm, cm, cm], 1) + scheck([cm, c4, cm, c4, cm, cm, cm, c1], 1) + scheck([cm, c4, cm, c4, cm, cm, cm, cm], 3) + scheck([cm, c4, cm, cm, c1], 1) + scheck([cm, c4, cm, cm, cm], 3) + scheck([cm, c4, cm, cm, cm, c1], 3) + scheck([cm, c4, cm, cm, cm, cm], 1) scheck([cm, cm], 2) end end