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

ruby-changes:41369

From: hsbt <ko1@a...>
Date: Tue, 5 Jan 2016 21:44:46 +0900 (JST)
Subject: [ruby-changes:41369] hsbt:r53441 (trunk): * test/ruby/test_string.rb(test_chr): added test for String#chr

hsbt	2016-01-05 21:44:55 +0900 (Tue, 05 Jan 2016)

  New Revision: 53441

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

  Log:
    * test/ruby/test_string.rb(test_chr): added test for String#chr
      [fix GH-1179]

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_string.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53440)
+++ ChangeLog	(revision 53441)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jan  5 21:43:50 2016  Kuniaki IGARASHI  <igaiga@g...>
+
+	* test/ruby/test_string.rb(test_chr): added test for String#chr
+	  [fix GH-1179]
+
 Tue Jan  5 21:32:26 2016  Kuniaki IGARASHI  <igaiga@g...>
 
 	* test/ruby/test_numeric.rb (test_nonzero_p): added test for String#nonzero?
Index: test/ruby/test_string.rb
===================================================================
--- test/ruby/test_string.rb	(revision 53440)
+++ test/ruby/test_string.rb	(revision 53441)
@@ -2349,6 +2349,13 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L2349
     assert_equal(0x3042, "\u3042\u3043".ord)
     assert_raise(ArgumentError) { "".ord }
   end
+
+  def test_chr
+    assert_equal("a", "abcde".chr)
+    assert_equal("a", "a".chr)
+    assert_equal("\u3042", "\u3042\u3043".chr)
+    assert_equal('', ''.chr)
+  end
 end
 
 class TestString2 < TestString

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

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