diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-14 01:55:07 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-14 01:55:07 +0000 |
commit | 4802149e44ac616ac50cd7a4315b5933f4a89b19 (patch) | |
tree | 03b13129020b16a9ad9e172dbcae1e5f6c9fa3ab /test/ruby/test_array.rb | |
parent | 9d6b7aede9c20ff46290d9d08027dc8a025f0e78 (diff) | |
download | ruby-4802149e44ac616ac50cd7a4315b5933f4a89b19.tar.gz |
array.c: non-recursive rpermute0
* array.c (rpermute0): remove recursion, by looping with indexes
stored in `p`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r-- | test/ruby/test_array.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 732a8ba44e..b9b2d5f88b 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -1780,6 +1780,12 @@ class TestArray < Test::Unit::TestCase a = @cls[0, 1, 2, 3, 4][1, 4].repeated_permutation(2) assert_empty(a.reject {|x| !x.include?(0)}) + + assert_separately([], <<-"end;") # do + assert_nothing_raised(SystemStackError) do + assert_equal(:ok, Array.new(100_000, nil).repeated_permutation(500_000) {break :ok}) + end + end; end def test_repeated_combination |