mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/test_rand.rb (TestRand#test_default_seed): add
srand case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
86af9bba63
commit
a014e9e8c6
2 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Oct 22 08:03:49 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* test/ruby/test_rand.rb (TestRand#test_default_seed): add
|
||||
srand case.
|
||||
|
||||
Thu Oct 22 06:33:38 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* random.c (InitVM_Random): move Random::DEFAULT initialization
|
||||
|
|
|
@ -531,6 +531,10 @@ END
|
|||
rand1 = Random::DEFAULT::rand
|
||||
rand2 = Random.new(seed).rand
|
||||
assert_equal(rand1, rand2)
|
||||
|
||||
srand seed
|
||||
rand3 = rand
|
||||
assert_equal(rand1, rand3)
|
||||
End
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue