diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-30 02:55:26 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-30 02:55:26 +0000 |
commit | b901b8754373038724936f1d32a0773dc65f0f64 (patch) | |
tree | 1d24e5355a24bfe4ab156caf7ddb16be0686658a /test/ruby/test_string.rb | |
parent | 950508e9b73543c4ec1846b3b7887613e9defc20 (diff) | |
download | ruby-b901b8754373038724936f1d32a0773dc65f0f64.tar.gz |
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
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 7 |
1 files 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! |