зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
b8d9770b6c
Коммит
78d15f5e35
|
@ -1,3 +1,8 @@
|
|||
Mon Dec 28 09:18:53 2015 Kuniaki IGARASHI <igaiga@gmail.com>
|
||||
|
||||
* test/ruby/test_string.rb (TestString#test_lstrip_bang): Add test
|
||||
for String#lstrip!. [Fix GH-1176]
|
||||
|
||||
Sun Dec 27 23:32:26 2015 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||
|
||||
* ext/win32ole/win32ole.c (ole_variant2val): refactoring.
|
||||
|
|
|
@ -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\)/)
|
||||
|
|
Загрузка…
Ссылка в новой задаче