mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
65793c9c17
commit
390f087d87
2 changed files with 23 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Jan 25 09:38:26 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
||||
|
||||
* 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@ruby-lang.org>
|
||||
|
||||
* lib/webrick/httpservlet/filehandler.rb: fix documentation for namespace.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue