aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_rand.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-07 22:22:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-07 22:22:36 +0000
commitf571492922083d0a02d2dc5ee5125af52935d5cd (patch)
tree57356bc5b6b0883e8b98c6331b0a7b4e409061d0 /test/ruby/test_rand.rb
parent0f58f9dbe7bf81595b78bcee9cab49a4a546ba80 (diff)
downloadruby-f571492922083d0a02d2dc5ee5125af52935d5cd.tar.gz
* random.c (rand_init): ignore higher bits if all they are same as
the lower sign bit. [ruby-core:29292](2) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_rand.rb')
-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 157f542dea..25c07d3288 100644
--- a/test/ruby/test_rand.rb
+++ b/test/ruby/test_rand.rb
@@ -398,4 +398,11 @@ END
assert(st.success?)
rescue NotImplementedError, ArgumentError
end
+
+ def test_seed
+ bug3104 = '[ruby-core:29292]'
+ 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)")
+ end
end