mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
* array.c (rb_ary_sample): negative sample number is invalid.
[ruby-core:23374] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
013b277316
commit
9936642c40
3 changed files with 8 additions and 0 deletions
|
@ -1605,6 +1605,8 @@ class TestArray < Test::Unit::TestCase
|
|||
end
|
||||
assert_operator(h.values.min * 2, :>=, h.values.max) if n != 0
|
||||
end
|
||||
|
||||
assert_raise(ArgumentError, '[ruby-core:23374]') {[1, 2].sample(-1)}
|
||||
end
|
||||
|
||||
def test_cycle
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue