diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-20 03:14:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-20 03:14:09 +0000 |
commit | e6a6dd8e7e1ef8acdf3c20137fa62926e60a4205 (patch) | |
tree | 7e2d62de2b9a4880ff27f9991f852e44d0b69b25 /test | |
parent | 241ad8877d7a085a4ad7427b21c1eaee6242d6e7 (diff) | |
download | ruby-e6a6dd8e7e1ef8acdf3c20137fa62926e60a4205.tar.gz |
string.c: wchar succ
* string.c (enc_succ_char, enc_pred_char): consider wchar case.
[ruby-core:56071] [Bug #8653]
* string.c (rb_str_succ): do not replace with invalid char.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_m17n_comb.rb | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb index 2de7179996..47a1f411c6 100644 --- a/test/ruby/test_m17n_comb.rb +++ b/test/ruby/test_m17n_comb.rb @@ -50,10 +50,12 @@ class TestM17NComb < Test::Unit::TestCase # for transitivity test u("\xe0\xa0\xa1"), e("\xe0\xa0\xa1"), s("\xe0\xa0\xa1"), # [ruby-dev:32693] e("\xa1\xa1"), a("\xa1\xa1"), s("\xa1\xa1"), # [ruby-dev:36484] + ] - #"aa".force_encoding("utf-16be"), - #"aaaa".force_encoding("utf-32be"), - #"aaa".force_encoding("utf-32be"), + WSTRINGS = [ + "aa".force_encoding("utf-16be"), + "aaaa".force_encoding("utf-32be"), + "aaa".force_encoding("utf-32be"), ] def combination(*args, &b) @@ -84,7 +86,7 @@ class TestM17NComb < Test::Unit::TestCase r end - def enccall(recv, meth, *args, &block) + def assert_enccall(recv, meth, *args, &block) desc = '' if String === recv desc << encdump(recv) @@ -113,6 +115,7 @@ class TestM17NComb < Test::Unit::TestCase } result end + alias enccall assert_enccall def assert_str_enc_propagation(t, s1, s2) if !s1.ascii_only? @@ -1327,6 +1330,14 @@ class TestM17NComb < Test::Unit::TestCase s = t } } + + Encoding.list.each do |enc| + next if enc.dummy? + {"A"=>"B", "A1"=>"A2", "A9"=>"B0", "9"=>"10", "Z"=>"AA"}.each do |orig, expected| + s = orig.encode(enc) + assert_strenc(expected.encode(enc), enc, s.succ, proc {"#{orig.dump}.encode(#{enc}).succ"}) + end + end end def test_str_hash |