diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-25 00:39:26 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-25 00:39:26 +0000 |
commit | 615073d07dca392e77382c81e76018429bb5dce1 (patch) | |
tree | 6e7a3606452d817d6c007591c9d6a6244977143d /test/ruby/test_string.rb | |
parent | 20f3c8d76fd354654e6d6bd95a409270dc9f3150 (diff) | |
download | ruby-615073d07dca392e77382c81e76018429bb5dce1.tar.gz |
* test/ruby/test_string.rb: added testcase for next!, succ and succ!
[fix GH-1213] Patch by @K0mAtoru
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 7eed784c8a..f1633e3d7b 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -995,6 +995,9 @@ class TestString < Test::Unit::TestCase 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 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 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 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 |