diff options
Diffstat (limited to 'test/-ext-/test_random.rb')
-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 |