summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-18 03:05:20 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-18 03:05:20 +0000
commitc626cb690412780c858d1b471dae1cb074054335 (patch)
tree78f17070a686205f1b543a22479f81567c827961
parent4c6713f37440a3b3de74d92e2ce82d6951fb2951 (diff)
* test/ruby/test_string.rb: Added extra testcase for test_rstrip_bang
and test_lstrip_bang. [fix GH-1178] Patch by @Matrixbirds git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_string.rb8
2 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 73f95af..157d98f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Jan 18 12:04:34 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* string.c: fix a typo. [fix GH-1202][ci skip] Patch by @sunboshan
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 0120bff..7eed784 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -2155,6 +2155,10 @@ class TestString < Test::Unit::TestCase
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
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