diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-23 22:07:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-23 22:07:39 +0000 |
commit | 2f6c0e3be38b057239eb044426c152ac5633c88f (patch) | |
tree | 694c7ce5c54b257050d1417974c970ec6cfd7651 /test/ruby/test_rand.rb | |
parent | 89339af9c19c28eaa9e2814fb75aa09768971f0e (diff) | |
download | ruby-2f6c0e3be38b057239eb044426c152ac5633c88f.tar.gz |
* array.c (rb_ary_shuffle_bang, rb_ary_sample): add optional
argument random. [ruby-dev:41923] [EXPERIMENTAL]
* random.c (rb_random_{int32,real,bytes}): fallback to normal
method invocation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_rand.rb')
-rw-r--r-- | test/ruby/test_rand.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb index 40b291f959..c3282cf804 100644 --- a/test/ruby/test_rand.rb +++ b/test/ruby/test_rand.rb @@ -171,6 +171,7 @@ class TestRand < Test::Unit::TestCase def test_shuffle srand(0) assert_equal([1,4,2,5,3], [1,2,3,4,5].shuffle) + assert_equal([1,4,2,5,3], [1,2,3,4,5].shuffle(random: Random.new(0))) end def test_big_seed |