mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* random.c (Init_Random): add Random::DEFAULT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b80d5f14df
commit
a4c0f7dfae
3 changed files with 24 additions and 1 deletions
|
@ -415,4 +415,16 @@ END
|
|||
assert_equal(r1, r2)
|
||||
}
|
||||
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
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue