summaryrefslogtreecommitdiff
path: root/test/ruby/test_rand.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-26 03:08:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-26 03:08:07 +0000
commit93bbd7869c60781094507babd761cd4fb191d58b (patch)
tree5328b0a5791bca8a8d5fc8ee6f5f34ddb048d313 /test/ruby/test_rand.rb
parentdd8d4f00751a869cf1aab0d257aedad0ebe0b627 (diff)
* random.c (random_rand): subtraction method of non-numeric can
return Float, and add the result of random to the beginning of range, not the opposite. [ruby-dev:41410] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_rand.rb')
-rw-r--r--test/ruby/test_rand.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb
index b4adc8eaf5..ed74c5b211 100644
--- a/test/ruby/test_rand.rb
+++ b/test/ruby/test_rand.rb
@@ -357,6 +357,9 @@ END
v = r.rand(3.1..4)
assert_instance_of(Float, v, '[ruby-core:24679]')
assert_includes(3.1..4, v)
+
+ now = Time.now
+ assert_equal(now, r.rand(now..now))
end
def test_random_float