Skip to content

Commit

Permalink
test/ruby/test_arithmetic_sequence.rb: restore test_last_bug17218
Browse files Browse the repository at this point in the history
And rename the existing `test_last_bug17218` to `test_to_a_bug17218`.
  • Loading branch information
mrkn committed Dec 9, 2020
1 parent bb489ac commit 2544f71
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/ruby/test_arithmetic_sequence.rb
Expand Up @@ -264,6 +264,11 @@ def test_last_with_rational
assert_instance_of Integer, res[1]
end

def test_last_bug17218
seq = (1.0997r .. 1.1r).step(0.0001r)
assert_equal(1.1r, seq.last, '[ruby-core:100312] [Bug #17218]')
end

def test_to_a
assert_equal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1.step(10).to_a)
assert_equal([1, 3, 5, 7, 9], 1.step(10, 2).to_a)
Expand All @@ -279,7 +284,7 @@ def test_to_a_bug15444
'[ruby-core:90648] [Bug #15444]')
end

def test_last_bug17218
def test_to_a_bug17218
seq = (1.0997r .. 1.1r).step(0.0001r)
assert_equal([1.0997r, 1.0998r, 1.0999r, 1.1r], seq.to_a, '[ruby-core:100312] [Bug #17218]')
end
Expand Down

0 comments on commit 2544f71

Please sign in to comment.