diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-29 11:16:17 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-29 11:16:17 +0900 |
commit | 1cf5a31e7a00c3900bb8bdc358606f66a729d4f7 (patch) | |
tree | d426de35f1725f50b3d37ae87847b14108e23195 /test | |
parent | d92289cd8d5cac784ae856fb777f10dbc9f91b62 (diff) | |
download | ruby-1cf5a31e7a00c3900bb8bdc358606f66a729d4f7.tar.gz |
Aseert exception at negative step for non-endless range too
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_range.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index 546b1ad8ca..0dee88e7f9 100644 --- a/test/ruby/test_range.rb +++ b/test/ruby/test_range.rb @@ -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) { } } |