1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
kazu 2008-01-18 05:43:03 +00:00
parent c58736dbdc
commit 4d1ee83e3c
2 changed files with 43 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Fri Jan 18 14:36:34 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* test/ruby/test_m17n.rb (test_str_dump): added test for
String#dump. [ruby-dev:33142]
Fri Jan 18 12:25:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* encoding.c (load_encoding): check if successfully loaded.

View file

@ -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"
[