mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 09:04:05 +02:00
* array.c (rb_ary_shuffle_bang): check number of argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3dc6edf793
commit
7e4015e16d
3 changed files with 8 additions and 0 deletions
|
@ -1893,6 +1893,7 @@ class TestArray < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
gen = Random.new(0)
|
||||
assert_raise(ArgumentError) {[1, 2, 3].shuffle(1, random: gen)}
|
||||
srand(0)
|
||||
100.times do
|
||||
assert_equal([0, 1, 2].shuffle, [0, 1, 2].shuffle(random: gen))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue