diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-28 06:19:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-28 06:19:11 +0000 |
commit | 01c24a2f78cb65c813331a9d590304c4352a4b34 (patch) | |
tree | 07f670adc3c8db609fb33978ad1c31c2a01e7a4e /test/ruby/test_string.rb | |
parent | 53635dea12e9459168b45647cf52e26e0f1d451b (diff) | |
download | ruby-01c24a2f78cb65c813331a9d590304c4352a4b34.tar.gz |
* 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
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 6ed3100f3e..ff9b6f8e70 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -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 |