diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-05 00:03:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-05 00:03:45 +0000 |
commit | 74ba0cfc622925c2527b3d281802a3d1ab86363d (patch) | |
tree | ebcdcef3fdff8569f3882c64d6b0d4f7763c9809 /test/ruby | |
parent | 4509b36666730c9676b0768ec0c8f9746e8aeb4b (diff) | |
download | ruby-74ba0cfc622925c2527b3d281802a3d1ab86363d.tar.gz |
random.c: private rand
* random.c (rb_random_ulong_limited): do not call private method
rand. [ruby-dev:49892] [Misc #13003]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_array.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index bdb603bec5..24a8eae346 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -2337,6 +2337,13 @@ class TestArray < Test::Unit::TestCase end ary = (0...10000).to_a assert_equal(ary.rotate, ary.shuffle(random: gen_to_int)) + + assert_raise(NoMethodError) { + ary.shuffle(random: Object.new) + } + assert_raise(NoMethodError) { + ary.shuffle!(random: Object.new) + } end def test_sample @@ -2437,6 +2444,10 @@ class TestArray < Test::Unit::TestCase end ary = (0...10000).to_a assert_equal(5000, ary.sample(random: gen_to_int)) + + assert_raise(NoMethodError) { + ary.sample(random: Object.new) + } end def test_cycle |