From b901b8754373038724936f1d32a0773dc65f0f64 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 30 May 2014 02:55:26 +0000 Subject: [PATCH] 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 --- test/ruby/test_string.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 0fd49d232d..e8decc0386 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -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!