diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-20 00:23:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-20 00:23:01 +0000 |
commit | db885d0850653425b2c7896f9e6730c57b030ab1 (patch) | |
tree | 260eac03069a731723cedfe6daa81e8f9ee9ec65 /test/ruby/test_range.rb | |
parent | ad5a6aa790068a323f9129e92b383c9685700b51 (diff) |
range.c: step in bignum
* range.c (range_step): honor step in bignum addition.
[Feature #12912]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_range.rb')
-rw-r--r-- | test/ruby/test_range.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index dbfe495f29..beb0b956cd 100644 --- a/test/ruby/test_range.rb +++ b/test/ruby/test_range.rb @@ -245,10 +245,13 @@ class TestRange < Test::Unit::TestCase (2**32-1 .. ).step(2) {|x| a << x; break if a.size == 2 } assert_equal([4294967295, 4294967297], a) - a = [] max = RbConfig::LIMITS["FIXNUM_MAX"] + a = [] (max..).step {|x| a << x; break if a.size == 2 } assert_equal([max, max+1], a) + a = [] + (max..).step(max) {|x| a << x; break if a.size == 4 } + assert_equal([max, 2*max, 3*max, 4*max], a) o1 = Object.new o2 = Object.new |