From 9998481d4efaf86dde652617ed3b2777924c3373 Mon Sep 17 00:00:00 2001 From: duerst Date: Thu, 3 Dec 2009 11:29:33 +0000 Subject: * enc/trans/gb18030-tbl.rb: Fix omission of C1 region in code table (from Tatsuya Mizuno) * test/ruby/test_transcode.rb: Added test for converting full range of Unicode codepoints from/to GB18030 (from Tatsuya Mizuno) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_transcode.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb index 2cc23bae8f..bec153b491 100644 --- a/test/ruby/test_transcode.rb +++ b/test/ruby/test_transcode.rb @@ -1578,7 +1578,13 @@ class TestTranscode < Test::Unit::TestCase end def test_gb18030 - # test from GBK + # overall roundtrip test + all_gb18030 = (0x0..0xD7FF).to_a.pack 'U*' #追加 + all_gb18030 << (0xE000..0xFFFF).to_a.pack("U*") #追加 + + assert_equal(all_gb18030, all_gb18030.encode("gb18030").encode("UTF-8")) #追加 + + # tests from GBK check_both_ways("\u4E02", "\x81\x40", 'GB18030') # check_both_ways("\u4E8A", "\x81\x7E", 'GB18030') # check_both_ways("\u4E90", "\x81\x80", 'GB18030') # @@ -1691,7 +1697,7 @@ class TestTranscode < Test::Unit::TestCase check_both_ways("\u9752\u5C71\u5B66\u9662\u5927\u5B66", "\xC7\xE0\xC9\xBD\xD1\xA7\xD4\xBA\xB4\xF3\xD1\xA7", 'GB18030') # 青山学院大学 check_both_ways("\u795E\u6797\u7FA9\u535A", "\xC9\xF1\xC1\xD6\xC1\x78\xB2\xA9", 'GB18030') # 神林義 - # new tests for GB18030 + # new tests for GB18030 check_both_ways("\u9FA6", "\x82\x35\x8F\x33", 'GB18030') # 龦 check_both_ways("\uD7FF", "\x83\x36\xC7\x38", 'GB18030') # No name () -- cgit v1.2.3