From 3330ec6cffd7fc128e23b6021689e6a58851bfd0 Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 2 May 2008 07:52:01 +0000 Subject: add tests for [ruby-dev:34557] and [ruby-dev:34558]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_range.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index 09781dd407..81be101857 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 -- cgit v1.2.3