summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-20 03:04:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-20 03:04:59 +0000
commit99aaee351e42ca0d823ca959241668dc2eb77df2 (patch)
tree6eb5fcbb8e18e5c16d4a5be34f28a6ff9b4acef0 /test
parentc62c8f725d3786ddd9341f8207742205dd35140d (diff)
* random.c (random_rand): get rid of overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_rand.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb
index c3282cf804..5ff2fe5e68 100644
--- a/test/ruby/test_rand.rb
+++ b/test/ruby/test_rand.rb
@@ -379,6 +379,8 @@ END
assert_in_delta(1.7151893663724195, r.rand(1.0...2.0), 0.0001, '[ruby-core:24655]')
assert_in_delta(7.027633760716439, r.rand(1.0...11.0), 0.0001, '[ruby-core:24655]')
assert_in_delta(3.0897663659937937, r.rand(2.0...4.0), 0.0001, '[ruby-core:24655]')
+
+ assert_nothing_raised {r.rand(-Float::MAX..Float::MAX)}
end
def test_random_equal