From 5453b6d4a7423e4c4b949bc27da03e6667f80293 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: svn+ssh://ci.ruby-lang.org/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/ruby') diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 36abe09963..384ce239f9 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 v1.2.3