ruby-changes:41575
From: hsbt <ko1@a...>
Date: Mon, 25 Jan 2016 09:38:36 +0900 (JST)
Subject: [ruby-changes:41575] hsbt:r53649 (trunk): * test/ruby/test_string.rb: added testcase for next!, succ and succ!
hsbt 2016-01-25 09:39:26 +0900 (Mon, 25 Jan 2016) New Revision: 53649 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53649 Log: * test/ruby/test_string.rb: added testcase for next!, succ and succ! [fix GH-1213] Patch by @K0mAtoru Modified files: trunk/ChangeLog trunk/test/ruby/test_string.rb Index: test/ruby/test_string.rb =================================================================== --- test/ruby/test_string.rb (revision 53648) +++ test/ruby/test_string.rb (revision 53649) @@ -995,6 +995,9 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L995 assert_equal(S("AAAAA000"), S("ZZZZ999").next) assert_equal(S("*+"), S("**").next) + + assert_equal(S("!"), S(" ").next) + assert_equal(S(""), S("").next) end def test_next! @@ -1031,6 +1034,10 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L1034 a = S("**") assert_equal(S("*+"), a.next!) assert_equal(S("*+"), a) + + a = S(" ") + assert_equal(S("!"), a.next!) + assert_equal(S("!"), a) end def test_oct @@ -1541,6 +1548,9 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L1548 assert_equal("2000aaa", "1999zzz".succ) assert_equal("AAAA0000", "ZZZ9999".succ) assert_equal("**+", "***".succ) + + assert_equal("!", " ".succ) + assert_equal("", "".succ) end def test_succ! @@ -1582,6 +1592,14 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L1592 assert_equal(S("No.10"), a.succ!) assert_equal(S("No.10"), a) + a = S(" ") + assert_equal(S("!"), a.succ!) + assert_equal(S("!"), a) + + a = S("") + assert_equal(S(""), a.succ!) + assert_equal(S(""), a) + assert_equal("aaaaaaaaaaaa", "zzzzzzzzzzz".succ!) assert_equal("aaaaaaaaaaaaaaaaaaaaaaaa", "zzzzzzzzzzzzzzzzzzzzzzz".succ!) end Index: ChangeLog =================================================================== --- ChangeLog (revision 53648) +++ ChangeLog (revision 53649) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Jan 25 09:38:26 2016 SHIBATA Hiroshi <hsbt@r...> + + * test/ruby/test_string.rb: added testcase for next!, succ and succ! + [fix GH-1213] Patch by @K0mAtoru + Mon Jan 25 09:32:25 2016 SHIBATA Hiroshi <hsbt@r...> * lib/webrick/httpservlet/filehandler.rb: fix documentation for namespace. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/