diff options
author | Kenta Murata <[email protected]> | 2020-10-23 15:26:51 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-23 15:26:51 +0900 |
commit | f754b422855131111092c0c147d744775cc4793f (patch) | |
tree | 1ca57f3b6cedb36549c456a79a57cffce940e6fc /test/ruby/test_arithmetic_sequence.rb | |
parent | 40bad72f31248c48048249b1d7536e87b4994664 (diff) |
numeric.c, range.c: prohibit zero step
* numeric.c: prohibit zero step in Numeric#step
* range.c: prohibit zero step in Range#step
* Fix ruby-spec
[Feature #15573]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3689
Merged-By: mrkn <[email protected]>
Diffstat (limited to 'test/ruby/test_arithmetic_sequence.rb')
-rw-r--r-- | test/ruby/test_arithmetic_sequence.rb | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/test/ruby/test_arithmetic_sequence.rb b/test/ruby/test_arithmetic_sequence.rb index 45a0ab9222..70ec113e61 100644 --- a/test/ruby/test_arithmetic_sequence.rb +++ b/test/ruby/test_arithmetic_sequence.rb @@ -162,11 +162,6 @@ class TestArithmeticSequence < Test::Unit::TestCase assert_equal([], seq.first(1)) assert_equal([], seq.first(3)) - seq = 1.step(10, by: 0) - assert_equal(1, seq.first) - assert_equal([1], seq.first(1)) - assert_equal([1, 1, 1], seq.first(3)) - seq = 10.0.step(-1.0, by: -2.0) assert_equal(10.0, seq.first) assert_equal([10.0], seq.first(1)) @@ -340,9 +335,6 @@ class TestArithmeticSequence < Test::Unit::TestCase [10, 8, 6, 4, 2].each do |i| assert_equal(i, seq.next) end - - seq = ((1/10r)..(1/2r)).step(0) - assert_equal(1/10r, seq.next) end def test_next_bug15444 |