[前][次][番号順一覧][スレッド一覧]

ruby-changes:34163

From: nobu <ko1@a...>
Date: Fri, 30 May 2014 11:55:32 +0900 (JST)
Subject: [ruby-changes:34163] nobu:r46244 (trunk): test_string.rb: move and add assertions

nobu	2014-05-30 11:55:26 +0900 (Fri, 30 May 2014)

  New Revision: 46244

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=46244&view=revision

  Log:
    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].

  Modified files:
    trunk/test/ruby/test_string.rb
Index: test/ruby/test_string.rb
===================================================================
--- test/ruby/test_string.rb	(revision 46243)
+++ test/ruby/test_string.rb	(revision 46244)
@@ -894,8 +894,6 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L894
     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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L1195
     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!

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]