summaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/enc/test_gb18030.rb53
1 files changed, 27 insertions, 26 deletions
diff --git a/test/ruby/enc/test_gb18030.rb b/test/ruby/enc/test_gb18030.rb
index a33a9eb28..f379504d4 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