diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-21 14:47:02 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-21 14:47:02 +0000 |
| commit | 08fc80ffe54d749c3657457eee7f23e0bbc471bc (patch) | |
| tree | 7efc61d39580d58bb23212e5ba3a28e27b92a34a /test | |
| parent | 6afe623d23ce3bec3a97d32c5156a0f01bcd7fcf (diff) | |
merges r23359 from trunk into ruby_1_9_1.
--
* array.c (rb_ary_sample): negative sample number is invalid.
[ruby-core:23374]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_array.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 36abe0996..384ce239f 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -1588,6 +1588,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 |
