mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Aseert exception at negative step for non-endless range too
This commit is contained in:
parent
d92289cd8d
commit
1cf5a31e7a
1 changed files with 1 additions and 0 deletions
|
@ -251,6 +251,7 @@ class TestRange < Test::Unit::TestCase
|
|||
assert_kind_of(Enumerator::ArithmeticSequence, (..10).step(2))
|
||||
assert_kind_of(Enumerator::ArithmeticSequence, (1..).step(2))
|
||||
|
||||
assert_raise(ArgumentError) { (0..10).step(-1) { } }
|
||||
assert_raise(ArgumentError) { (0..10).step(0) { } }
|
||||
assert_raise(ArgumentError) { (0..).step(-1) { } }
|
||||
assert_raise(ArgumentError) { (0..).step(0) { } }
|
||||
|
|
Loading…
Add table
Reference in a new issue