ruby-changes:41498
From: hsbt <ko1@a...>
Date: Mon, 18 Jan 2016 12:04:48 +0900 (JST)
Subject: [ruby-changes:41498] hsbt:r53572 (trunk): * test/ruby/test_string.rb: Added extra testcase for test_rstrip_bang
hsbt 2016-01-18 12:05:20 +0900 (Mon, 18 Jan 2016) New Revision: 53572 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53572 Log: * test/ruby/test_string.rb: Added extra testcase for test_rstrip_bang and test_lstrip_bang. [fix GH-1178] Patch by @Matrixbirds Modified files: trunk/ChangeLog trunk/test/ruby/test_string.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 53571) +++ ChangeLog (revision 53572) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Jan 18 12:04:34 2016 SHIBATA Hiroshi <hsbt@r...> + + * test/ruby/test_string.rb: Added extra testcase for test_rstrip_bang + and test_lstrip_bang. [fix GH-1178] Patch by @Matrixbirds + Mon Jan 18 11:47:27 2016 SHIBATA Hiroshi <hsbt@r...> * string.c: fix a typo. [fix GH-1202][ci skip] Patch by @sunboshan Index: test/ruby/test_string.rb =================================================================== --- test/ruby/test_string.rb (revision 53571) +++ test/ruby/test_string.rb (revision 53572) @@ -2155,6 +2155,10 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L2155 assert_equal(nil, s3.rstrip!) assert_equal(" \u3042", s3) + s4 = S("\u3042") + assert_equal(nil, s4.rstrip!) + assert_equal("\u3042", s4) + assert_raise(Encoding::CompatibilityError) { "\u3042".encode("ISO-2022-JP").rstrip! } end @@ -2175,6 +2179,10 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L2179 s3 = S(" \u3042") assert_equal("\u3042", s3.lstrip!) assert_equal("\u3042", s3) + + s4 = S("\u3042") + assert_equal(nil, s4.lstrip!) + assert_equal("\u3042", s4) end =begin -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/