diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-04-15 00:52:08 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-09-07 20:08:01 +0900 |
commit | d6ec0ef59b4c7c95beaad09f77cb5f86a0901b97 (patch) | |
tree | 66d692d6abe2f2bb3c7c620544ba266b578d7909 /test/-ext- | |
parent | c449b9b02f63cf8268a0eb9639a43caf4598996d (diff) |
Added `get_real` interface
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3024
Diffstat (limited to 'test/-ext-')
-rw-r--r-- | test/-ext-/test_random.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/-ext-/test_random.rb b/test/-ext-/test_random.rb index da716c71c0..838e5d2f14 100644 --- a/test/-ext-/test_random.rb +++ b/test/-ext-/test_random.rb @@ -16,5 +16,12 @@ module TestRandomExt rnd = Bug::Random::Loop.new(1) assert_equal(1, rnd.rand(10)) end + + def test_real + assert_equal(0.25, Bug::Random::Loop.new(1<<14).rand) + assert_equal(0.50, Bug::Random::Loop.new(2<<14).rand) + assert_equal(0.75, Bug::Random::Loop.new(3<<14).rand) + assert_equal(1.00, Bug::Random::Loop.new(4<<14).rand) + end end end |