diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-19 18:56:50 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-19 18:56:50 +0000 |
commit | d0ce29fbee96a7a0b55f9c8f5e7e4b1b617a631b (patch) | |
tree | 421ec1c4db10db7bfcc016378a67dbca5c29a239 /test/ruby/test_m17n.rb | |
parent | 55723ea86d46c567a5b9547aa943d4dd3c21af65 (diff) | |
download | ruby-d0ce29fbee96a7a0b55f9c8f5e7e4b1b617a631b.tar.gz |
update encdump for UTF-16.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n.rb')
-rw-r--r-- | test/ruby/test_m17n.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index 0ad7da9a60..8bdcd26c4b 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -79,7 +79,12 @@ class TestM17N < Test::Unit::TestCase end def encdump(str) - "#{str.dump}.force_encoding(#{str.encoding.name.dump})" + d = str.dump + if /\.force_encoding\("[A-Za-z0-9.:_+-]*"\)\z/ =~ d + d + else + "#{d}.force_encoding(#{str.encoding.name.dump})" + end end def encdumpargs(args) @@ -287,7 +292,8 @@ class TestM17N < Test::Unit::TestCase end def test_utf16_valid_encoding - assert_equal(false, "\xd8\x00\xd8\x00".force_encoding("utf-16be").valid_encoding?) + s = "\xd8\x00\xd8\x00".force_encoding("utf-16be") + assert_equal(false, s.valid_encoding?, "#{encdump s}.valid_encoding?") end def test_utf16 |