diff options
| author | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-18 05:43:03 +0000 |
|---|---|---|
| committer | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-18 05:43:03 +0000 |
| commit | e8c82c5ce7398737bdbadbff00c22ca47f5332cb (patch) | |
| tree | bd48d533fd5706ac985b5e4eec534a07a53280d1 /test/ruby | |
| parent | e9836b1b460e6839fda2256517d925b43a2c6d71 (diff) | |
| download | ruby-e8c82c5ce7398737bdbadbff00c22ca47f5332cb.tar.gz ruby-e8c82c5ce7398737bdbadbff00c22ca47f5332cb.tar.xz ruby-e8c82c5ce7398737bdbadbff00c22ca47f5332cb.zip | |
* test/ruby/test_m17n.rb (test_str_dump): added test for
String#dump. [ruby-dev:33142]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_m17n.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index f04c38622..9e4c06123 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -189,6 +189,44 @@ class TestM17N < Test::Unit::TestCase assert_equal('"\xFC"', u("\xfc").inspect) end + def test_str_dump + [ + e("\xfe"), + e("\x8e"), + e("\x8f"), + e("\x8f\xa1"), + s("\xef"), + u("\xc2"), + u("\xe0\x80"), + u("\xf0\x80\x80"), + u("\xf8\x80\x80\x80"), + u("\xfc\x80\x80\x80\x80"), + + e("\xfe "), + e("\x8e "), + e("\x8f "), + e("\x8f\xa1 "), + s("\xef "), + u("\xc2 "), + u("\xe0\x80 "), + u("\xf0\x80\x80 "), + u("\xf8\x80\x80\x80 "), + u("\xfc\x80\x80\x80\x80 "), + + + e("\xa1\x8f\xa1\xa1"), + + s("\x81."), + s("\x81@"), + + u("\xfc"), + "\u3042", + "ascii", + ].each do |str| + assert_equal(str, eval(str.dump), "[ruby-dev:33142]") + end + end + def test_validate_redundant_utf8 bits_0x10ffff = "11110100 10001111 10111111 10111111" [ |
