ruby-changes:15100
From: akr <ko1@a...>
Date: Fri, 19 Mar 2010 08:11:25 +0900 (JST)
Subject: [ruby-changes:15100] Ruby:r26977 (trunk): add test.
akr 2010-03-19 08:11:12 +0900 (Fri, 19 Mar 2010) New Revision: 26977 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26977 Log: add test. Modified files: trunk/test/ruby/test_string.rb Index: test/ruby/test_string.rb =================================================================== --- test/ruby/test_string.rb (revision 26976) +++ test/ruby/test_string.rb (revision 26977) @@ -1364,6 +1364,15 @@ } 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/