summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_string.rb8
1 files changed, 8 insertions, 0 deletions
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