aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_rand.rb7
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