mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* random.c (rb_f_rand): type check simplified. strings are no
longer allowed for argument. [ruby-dev:37655] * test/ruby/test_rand.rb (TestRand::o.to_int): need override to_int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
db86fef72f
commit
6bbd76a732
3 changed files with 26 additions and 36 deletions
|
@ -144,7 +144,7 @@ class TestRand < Test::Unit::TestCase
|
|||
0.000000000000001)
|
||||
srand(0)
|
||||
o = Object.new
|
||||
def o.to_i; 100; end
|
||||
def o.to_int; 100; end
|
||||
assert_equal(44, rand(o))
|
||||
assert_equal(47, rand(o))
|
||||
assert_equal(64, rand(o))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue