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

fix test. [ruby-dev:32625].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-12-18 10:17:25 +00:00
parent ec69dddc0d
commit 400009cac2

View file

@ -804,16 +804,23 @@ class TestM17N < Test::Unit::TestCase
assert_raise(IndexError) { t[i] = s2 }
else
t[i] = s2
if !s1.valid_encoding? || !s2.valid_encoding?
assert(a(t).index(a(s2)))
else
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], "t = #{encinsp(s1)}; t[#{i}] = #{encinsp(s2)}; t[#{i}]")
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
}
}
}