ruby-changes:1803
From: ko1@a...
Date: 28 Aug 2007 15:19:20 +0900
Subject: [ruby-changes:1803] nobu - Ruby:r13294 (trunk): * test/ruby/test_string.rb (test_splice!): tests for .
nobu 2007-08-28 15:19:11 +0900 (Tue, 28 Aug 2007) New Revision: 13294 Modified files: trunk/test/ruby/test_string.rb Log: * test/ruby/test_string.rb (test_splice!): tests for [ruby-dev:31665]. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_string.rb?r1=13294&r2=13293 Index: test/ruby/test_string.rb =================================================================== --- test/ruby/test_string.rb (revision 13293) +++ test/ruby/test_string.rb (revision 13294) @@ -1338,4 +1338,12 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml