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:
parent
a06fc80da6
commit
bdc00ba604
6 changed files with 54 additions and 34 deletions
|
@ -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) { } }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue