mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
7f31465bb5
commit
3330ec6cff
1 changed files with 14 additions and 0 deletions
|
@ -147,6 +147,20 @@ class TestRange < Test::Unit::TestCase
|
||||||
a = []
|
a = []
|
||||||
(o1...o2).step(1) {|x| a << x }
|
(o1...o2).step(1) {|x| a << x }
|
||||||
assert_equal([o1], a)
|
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
|
end
|
||||||
|
|
||||||
def test_each
|
def test_each
|
||||||
|
|
Loading…
Reference in a new issue