summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-18 23:11:12 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-18 23:11:12 +0000
commit4f74adc503a13bbd19d451cab7e6ab6b685776bc (patch)
tree433410c77b68272a4dc8291c0ac53b02a89d87ca
parent642305dae64ab30099cc2925f7f5485c8e0128e5 (diff)
add test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_string.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 5d6d6d7ab8..9dd3ea90ce 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -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