diff --git a/ChangeLog b/ChangeLog index 73f95af7eb..157d98f21b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jan 18 12:04:34 2016 SHIBATA Hiroshi + + * 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 * 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 0120bff9bd..7eed784c8a 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