From 08fc80ffe54d749c3657457eee7f23e0bbc471bc Mon Sep 17 00:00:00 2001 From: yugui Date: Thu, 21 May 2009 14:47:02 +0000 Subject: 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 --- test/ruby/test_array.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') 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 -- cgit