1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_string.rb (test_splice!): tests for [ruby-dev:31665].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-08-28 06:19:11 +00:00
parent 53635dea12
commit 01c24a2f78

View file

@ -1338,4 +1338,12 @@ class TestString < Test::Unit::TestCase
assert_equal(676, count)
end
def test_splice!
l = S("1234\n234\n34\n4\n")
assert_equal(S("1234\n"), l.slice!(/\A.*\n/), "[ruby-dev:31665]")
assert_equal(S("234\n"), l.slice!(/\A.*\n/), "[ruby-dev:31665]")
assert_equal(S("34\n"), l.slice!(/\A.*\n/), "[ruby-dev:31665]")
assert_equal(S("4\n"), l.slice!(/\A.*\n/), "[ruby-dev:31665]")
assert_nil(l.slice!(/\A.*\n/), "[ruby-dev:31665]")
end
end