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

test_string.rb: move and add assertions

* test/ruby/test_string.rb (test_slice): move the assertion for
  [Bug #9882], and more assertion for `ascii_only?` too, as
  pointed out by Heesob Park in [ruby-core:62846].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-05-30 02:55:26 +00:00
parent 950508e9b7
commit b901b87543

View file

@ -894,8 +894,6 @@ class TestString < Test::Unit::TestCase
assert_not_equal(S("a").hash, S("a\0").hash, bug4104)
bug9172 = '[ruby-core:58658] [Bug #9172]'
assert_not_equal(S("sub-setter").hash, S("discover").hash, bug9172)
bug9882 = '[ruby-core:62842] [Bug #9882]'
assert_equal(S(bug9882).hash, S("\u{30c6 30b9 30c8 2019}#{bug9882}")[4..-1].hash, bug9882)
end
def test_hash_random
@ -1197,6 +1195,11 @@ class TestString < Test::Unit::TestCase
assert_equal(S("Bar"), S("FooBar").slice(S("Bar")))
assert_nil(S("FooBar").slice(S("xyzzy")))
assert_nil(S("FooBar").slice(S("plugh")))
bug9882 = '[ruby-core:62842] [Bug #9882]'
substr = S("\u{30c6 30b9 30c8 2019}#{bug9882}").slice(4..-1)
assert_equal(S(bug9882).hash, substr.hash, bug9882)
assert_predicate(substr, :ascii_only?, bug9882)
end
def test_slice!