summaryrefslogtreecommitdiffstats
path: root/test/ruby
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-19 18:56:50 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-19 18:56:50 +0000
commit4682a3ef28a0a9d74a0cde92496dfe09770ac744 (patch)
tree421ec1c4db10db7bfcc016378a67dbca5c29a239 /test/ruby
parent80486b913ef05c97592fd74d95d999350aaea5d5 (diff)
downloadruby-4682a3ef28a0a9d74a0cde92496dfe09770ac744.tar.gz
ruby-4682a3ef28a0a9d74a0cde92496dfe09770ac744.tar.xz
ruby-4682a3ef28a0a9d74a0cde92496dfe09770ac744.zip
update encdump for UTF-16.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_m17n.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 0ad7da9a6..8bdcd26c4 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