diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-02 07:52:01 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-02 07:52:01 +0000 |
commit | 56a0b4b33cd86c60b6c73d14704ab85fa6c952ed (patch) | |
tree | d24f4ab3bce37ba49274cbed7f3083d3ebffd6ab /test | |
parent | 3fe1bb29ae4411dea836c21000ca540172dd086d (diff) | |
download | ruby-56a0b4b33cd86c60b6c73d14704ab85fa6c952ed.tar.gz ruby-56a0b4b33cd86c60b6c73d14704ab85fa6c952ed.tar.xz ruby-56a0b4b33cd86c60b6c73d14704ab85fa6c952ed.zip |
add tests for [ruby-dev:34557] and [ruby-dev:34558].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_range.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index 09781dd40..81be10185 100644 --- a/test/ruby/test_range.rb +++ b/test/ruby/test_range.rb @@ -147,6 +147,20 @@ class TestRange < Test::Unit::TestCase a = [] (o1...o2).step(1) {|x| a << x } assert_equal([o1], a) + + assert_nothing_raised("[ruby-dev:34557]") { (0..2).step(0.5) {|x| } } + + a = [] + (0..2).step(0.5) {|x| a << x } + assert_equal([0, 0.5, 1.0, 1.5, 2.0], a) + + a = [] + (0x40000000..0x40000002).step(0.5) {|x| a << x } + assert_equal([1073741824, 1073741824.5, 1073741825.0, 1073741825.5, 1073741826], a) + + o = Object.new + def o.to_int() 1 end + assert_nothing_raised("[ruby-dev:34558]") { (0..2).step(o) {|x| } } end def test_each |