From 6be87163311b6611de7c28e2d682265eabff1cb4 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 27 Jan 2008 08:21:24 +0000 Subject: * string.c (rb_str_succ): don't increment/decrement codepoint. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_m17n_comb.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb index 10e8b501e..ea93de1a4 100644 --- a/test/ruby/test_m17n_comb.rb +++ b/test/ruby/test_m17n_comb.rb @@ -1349,10 +1349,6 @@ class TestM17NComb < Test::Unit::TestCase end def test_str_succ - starts = [ - e("\xA1\xA1"), - e("\xFE\xFE") - ] STRINGS.each {|s0| next if s0.empty? s = s0.dup @@ -1360,11 +1356,16 @@ class TestM17NComb < Test::Unit::TestCase h = {} n.times {|i| if h[s] - assert(false, "#{encdump s} cycle with succ! #{i-h[s]} times") + 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! + assert_operator(s.length, :<=, s0.length + Math.log2(i+1) + 1, "#{encdump s0} succ #{i} times => #{encdump s}") + #puts encdump(s) + t = s.succ + if s.valid_encoding? + assert(t.valid_encoding?, "#{encdump s}.succ.valid_encoding?") + end + s = t } } end -- cgit