1
0
Fork 0
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:
Nobuyoshi Nakada 2019-08-29 11:16:17 +09:00
parent d92289cd8d
commit 1cf5a31e7a
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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) { } }