diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-14 14:50:46 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-14 14:50:46 +0000 |
commit | 9d5f651a9815bce2ff48010f50b591af722b7712 (patch) | |
tree | 0cd57da6189ebae5c9342660defe5e4271bd5809 /test/ruby/test_range.rb | |
parent | 716a99389c36e7e15c932f8ce4a0229b9756b185 (diff) | |
download | ruby-9d5f651a9815bce2ff48010f50b591af722b7712.tar.gz |
* numeric.c (ruby_float_step): wrong loop condition.
fixes [ruby-core:35753], reported by Joey Zhou.
* test/ruby/test_range.rb (TestRange#test_step_ruby_core_35753):
test above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_range.rb')
-rw-r--r-- | test/ruby/test_range.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index a2935955de..12ba47c219 100644 --- a/test/ruby/test_range.rb +++ b/test/ruby/test_range.rb @@ -182,6 +182,15 @@ class TestRange < Test::Unit::TestCase assert_nothing_raised("[ruby-dev:34558]") { (0..2).step(o) {|x| } } end + def test_step_ruby_core_35753 + assert_equal(6, (1...6.3).step.to_a.size) + assert_equal(5, (1.1...6).step.to_a.size) + assert_equal(5, (1...6).step(1.1).to_a.size) + assert_equal(3, (1.0...6.3).step(1.8).to_a.size) + assert_equal(3, (1.0...6.4).step(1.8).to_a.size) + assert_equal(4, (1.0...6.5).step(1.8).to_a.size) + end + def test_each a = [] (0..10).each {|x| a << x } |