1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2009-10-29 19:28:49 +00:00
parent ec2c82ba7f
commit 0afb3e381d

View file

@ -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