ruby-changes:3100
From: ko1@a...
Date: 24 Dec 2007 17:57:18 +0900
Subject: [ruby-changes:3100] akr - Ruby:r14592 (trunk): refine a test.
akr 2007-12-24 17:57:09 +0900 (Mon, 24 Dec 2007) New Revision: 14592 Modified files: trunk/test/ruby/test_m17n.rb Log: refine a test. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_m17n.rb?r1=14592&r2=14591 Index: test/ruby/test_m17n.rb =================================================================== --- test/ruby/test_m17n.rb (revision 14591) +++ test/ruby/test_m17n.rb (revision 14592) @@ -84,10 +84,13 @@ 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 @@ 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! } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml