diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-11-09 19:36:37 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-11-10 12:06:13 +0900 |
| commit | b7e8876704648cee6866591ac1aca7a54faff742 (patch) | |
| tree | e21c0a9176378eedfdcc46a64ba12456fa03429f /test/ruby | |
| parent | 6eaed20e145c1ab4c9c4ccf669d0ebea934f4d36 (diff) | |
[Bug #19100] Add `init_int32` function to `rb_random_interface_t`
Distinguish initialization by single word from initialization by
array.
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_rand.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb index f066433f6a..a4beffd689 100644 --- a/test/ruby/test_rand.rb +++ b/test/ruby/test_rand.rb @@ -336,6 +336,14 @@ class TestRand < Test::Unit::TestCase } end + def test_seed_leading_zero_guard + guard = 1<<32 + range = 0...(1<<32) + all_assertions_foreach(nil, 0, 1, 2) do |i| + assert_not_equal(Random.new(i).rand(range), Random.new(i+guard).rand(range)) + end + end + def test_marshal bug3656 = '[ruby-core:31622]' assert_raise(TypeError, bug3656) { |
