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 | 4d1ee83e3c1e87597e0abb15dffd15d4b450d9be (patch) | |
tree | bd48d533fd5706ac985b5e4eec534a07a53280d1 /test/ruby | |
parent | c58736dbdc74400d7ce58804e46b10c406b91c20 (diff) | |
download | ruby-4d1ee83e3c1e87597e0abb15dffd15d4b450d9be.tar.gz |
* test/ruby/test_m17n.rb (test_str_dump): added test for
String#dump. [ruby-dev:33142]
git-svn-id: svn+ssh://ci.ruby-lang.org/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 f04c386224..9e4c061233 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" [ |