1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* bignum.c (rb_cmpint): moved from compar.c, to check bignum

zero.

* range.c (range_step): add step for each iteration if begin and
  end are numeric.  [ruby-core:15990]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-04-06 17:11:50 +00:00
parent a06fc80da6
commit bdc00ba604
6 changed files with 54 additions and 34 deletions

View file

@ -114,12 +114,6 @@ class TestRange < Test::Unit::TestCase
(0..10).step(2) {|x| a << x }
assert_equal([0, 2, 4, 6, 8, 10], a)
o = Object.new
def o.to_int; 2; end
a = []
(0..10).step(o) {|x| a << x }
assert_equal([0, 2, 4, 6, 8, 10], a)
assert_raise(ArgumentError) { (0..10).step(-1) { } }
assert_raise(ArgumentError) { (0..10).step(0) { } }