diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-12 20:50:45 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-12 20:50:45 +0000 |
commit | 9afaef347c84e8e90312d3335c887d2c65acc86b (patch) | |
tree | 2569b71a9fbc506c84a5a413111f89829c3c2164 /test | |
parent | db9119bedfed116201ed0caffac964825c7ac964 (diff) |
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_rand.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb index 25c07d3288..b4adc8eaf5 100644 --- a/test/ruby/test_rand.rb +++ b/test/ruby/test_rand.rb @@ -404,5 +404,12 @@ END rand_1 = Random.new(-1).rand assert_not_equal(rand_1, Random.new((1 << 31) -1).rand, "#{bug3104} (2)") assert_not_equal(rand_1, Random.new((1 << 63) -1).rand, "#{bug3104} (2)") + + [-1, -2**10, -2**40].each {|n| + b = (2**64).coerce(n)[0] + r1 = Random.new(n).rand + r2 = Random.new(b).rand + assert_equal(r1, r2) + } end end |