diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 08:57:09 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 08:57:09 +0000 |
commit | 3a0577041c836fd4547a3046dbbb16b6cf91155c (patch) | |
tree | 4ad45e4bbb9f5d037f857095eb607a880b132e5c /test | |
parent | 1e8ac3279ddda6390ae9e7343c8ba23cc7259951 (diff) | |
download | ruby-3a0577041c836fd4547a3046dbbb16b6cf91155c.tar.gz ruby-3a0577041c836fd4547a3046dbbb16b6cf91155c.tar.xz ruby-3a0577041c836fd4547a3046dbbb16b6cf91155c.zip |
refine a test.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_m17n.rb | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index a6a85628c..0b7600b47 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -84,10 +84,13 @@ class TestM17N < Test::Unit::TestCase a("."), e("."), s("."), u("."), # single character - a("\x80"), - e("\xa1\xa1"), e("\x8e\xa1"), e("\x8f\xa1\xa1"), - s("\x81\x40"), s("\xa1"), - u("\xc2\x80"), + a("\x80"), a("\xff"), + e("\xa1\xa1"), e("\xfe\xfe"), + e("\x8e\xa1"), e("\x8e\xfe"), + e("\x8f\xa1\xa1"), e("\x8f\xfe\xfe"), + s("\x81\x40"), s("\xfc\xfc"), + s("\xa1"), s("\xdf"), + u("\xc2\x80"), u("\xf4\x8f\xbf\xbf"), # same byte sequence a("\xc2\xa1"), e("\xc2\xa1"), s("\xc2\xa1"), u("\xc2\xa1"), @@ -1821,10 +1824,16 @@ class TestM17N < Test::Unit::TestCase e("\xA1\xA1"), e("\xFE\xFE") ] - starts.each {|s0| + STRINGS.each {|s0| + next if s0.empty? s = s0.dup n = 1000 + h = {} n.times {|i| + if h[s] + assert(false, "#{encdump s} cycle with succ! #{i-h[s]} times") + end + h[s] = i assert_operator(s.length, :<=, s0.length + Math.log2(i+1) + 1, "#{encdump s0} succ! #{i} times => #{encdump s}") s.succ! } |