aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_rand.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-03 01:51:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-03 01:51:26 +0000
commit6decf411c6f8fd6778d8d4326a8dd8a0e2c09dcd (patch)
treee75fb0ead125ae468a85d7affceca9d2a62b9288 /test/ruby/test_rand.rb
parenta9aeb765c5b6681063682d67df75df96af5860b0 (diff)
downloadruby-6decf411c6f8fd6778d8d4326a8dd8a0e2c09dcd.tar.gz
* random.c (random_rand): raise ArgumentError on nil, as the
documentation implies. [ruby-core:29075] * random.c (rb_f_rand): mentioned the case of when max is nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_rand.rb')
-rw-r--r--test/ruby/test_rand.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb
index 97ac8147bd..157f542dea 100644
--- a/test/ruby/test_rand.rb
+++ b/test/ruby/test_rand.rb
@@ -207,6 +207,7 @@ class TestRand < Test::Unit::TestCase
assert_raise(ArgumentError, '[ruby-dev:39166]') { r.rand(0..-1) }
assert_raise(ArgumentError, '[ruby-dev:39166]') { r.rand(0.0...0.0) }
assert_raise(ArgumentError, '[ruby-dev:39166]') { r.rand(0.0...-0.1) }
+ assert_raise(ArgumentError, bug3027 = '[ruby-core:29075]') { r.rand(nil) }
end
def test_random_seed