mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* 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
This commit is contained in:
parent
a9aeb765c5
commit
6decf411c6
3 changed files with 10 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue