ruby-changes:2805
From: ko1@a...
Date: 18 Dec 2007 19:46:29 +0900
Subject: [ruby-changes:2805] akr - Ruby:r14296 (trunk): fix test. .
akr 2007-12-18 19:17:25 +0900 (Tue, 18 Dec 2007) New Revision: 14296 Modified files: trunk/test/ruby/test_m17n.rb Log: fix test. [ruby-dev:32625]. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_m17n.rb?r1=14296&r2=14295 Index: test/ruby/test_m17n.rb =================================================================== --- test/ruby/test_m17n.rb (revision 14295) +++ test/ruby/test_m17n.rb (revision 14296) @@ -804,16 +804,23 @@ assert_raise(IndexError) { t[i] = s2 } else t[i] = s2 - if i == s1.length && s2.empty? - assert_nil(t[i]) + if !s1.valid_encoding? || !s2.valid_encoding? + assert(a(t).index(a(s2))) else - assert_equal(s2, t[i], "t = #{encinsp(s1)}; t[#{i}] = #{encinsp(s2)}; t[#{i}]") + if i == s1.length && s2.empty? + assert_nil(t[i]) + elsif i < 0 + assert_equal(s2, t[i-s2.length+1,s2.length], + "t = #{encinsp(s1)}; t[#{i}] = #{encinsp(s2)}; t[#{i-s2.length+1},#{s2.length}]") + else + assert_equal(s2, t[i,s2.length], + "t = #{encinsp(s1)}; t[#{i}] = #{encinsp(s2)}; t[#{i},#{s2.length}]") + end end end else assert_raise(ArgumentError) { t[i] = s2 } end - } } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml