Skip to content

Commit

Permalink
* test/ruby/test_rand.rb (TestRand#test_default_seed): add
Browse files Browse the repository at this point in the history
  srand case.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
kosaki committed Nov 30, 2015
1 parent 86af9bb commit a014e9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions test/ruby/test_rand.rb
Expand Up @@ -531,6 +531,10 @@ def test_default_seed
rand1 = Random::DEFAULT::rand
rand2 = Random.new(seed).rand
assert_equal(rand1, rand2)
srand seed
rand3 = rand
assert_equal(rand1, rand3)
End
end
end

0 comments on commit a014e9e

Please sign in to comment.