diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-28 00:18:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-28 00:18:55 +0000 |
commit | adb965ff22f25dd11c1ce661d4244de23cb0d5ed (patch) | |
tree | 6f419b76e4affd77ca2547856b4d88f668c0f7d1 /test | |
parent | 7456fc990a94500cc98822042137d49255fbc5bb (diff) | |
download | ruby-adb965ff22f25dd11c1ce661d4244de23cb0d5ed.tar.gz |
Add test for String#lstrip!
* test/ruby/test_string.rb (TestString#test_lstrip_bang): Add test
for String#lstrip!. [Fix GH-1176]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_string.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 96137e3de9..778a817fdc 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -2147,6 +2147,20 @@ class TestString < Test::Unit::TestCase assert_equal("\u3042", " \u3042".lstrip) end + def test_lstrip_bang + s1 = S(" hello ") + assert_equal("hello ", s1.lstrip!) + assert_equal("hello ", s1) + + s2 = S("\u3042 ") + assert_equal(nil, s2.lstrip!) + assert_equal("\u3042 ", s2) + + s3 = S(" \u3042") + assert_equal("\u3042", s3.lstrip!) + assert_equal("\u3042", s3) + end + =begin def test_symbol_table_overflow assert_in_out_err([], <<-INPUT, [], /symbol table overflow \(symbol [a-z]{8}\) \(RuntimeError\)/) |