diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-11-26 04:25:42 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-11-27 17:03:30 +0900 |
commit | 2db2fb9f6c742d5bd0019ccd11c7a375e1b12c0b (patch) | |
tree | e5f464004a386e2838a700ad5cced540e8f9953c /test | |
parent | 8ce1711c255679d38b6a2405ff694eb5b5b2eae5 (diff) | |
download | ruby-2db2fb9f6c742d5bd0019ccd11c7a375e1b12c0b.tar.gz |
per-ractor Random::DEFAULT
Random generators are not Ractor-safe, so we need to prepare
per-ractor default random genearators. This patch set
`Random::DEFAULT = Randm` (not a Random instance, but the Random
class) and singleton methods like `Random.rand()` use a per-ractor
random generator.
[Feature #17322]
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_rand.rb | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb index 2fcac2d7d0..af10a27ce0 100644 --- a/test/ruby/test_rand.rb +++ b/test/ruby/test_rand.rb @@ -336,18 +336,6 @@ class TestRand < Test::Unit::TestCase } end - def test_default - r1 = Random::DEFAULT.dup - r2 = Random::DEFAULT.dup - 3.times do - x0 = rand - x1 = r1.rand - x2 = r2.rand - assert_equal(x0, x1) - assert_equal(x0, x2) - end - end - def test_marshal bug3656 = '[ruby-core:31622]' assert_raise(TypeError, bug3656) { |