mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
642305dae6
commit
4f74adc503
1 changed files with 9 additions and 0 deletions
|
@ -1364,6 +1364,15 @@ class TestString < Test::Unit::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
def test_sum_long
|
||||
s8421505 = "\xff" * 8421505
|
||||
assert_equal(127, s8421505.sum(31))
|
||||
assert_equal(2147483775, s8421505.sum(0))
|
||||
s16843010 = ("\xff" * 16843010)
|
||||
assert_equal(254, s16843010.sum(32))
|
||||
assert_equal(4294967550, s16843010.sum(0))
|
||||
end
|
||||
|
||||
def test_swapcase
|
||||
assert_equal(S("hi&LOW"), S("HI&low").swapcase)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue