mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/ruby/test_array.rb: split permute + stack error tests out.
* test/ruby/test_array.rb: split out the test for no stack error on large input for test_permutation, test_repeated_permutation, and test_repeated_combination, and make them all timeout:30. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1b49df0b3d
commit
4c0e360dd9
2 changed files with 14 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
Tue Mar 8 23:37:07 2016 Charles Oliver Nutter <headius@headius.com>
|
||||
|
||||
* test/ruby/test_array.rb: split out the test for no stack error
|
||||
on large input for test_permutation, test_repeated_permutation,
|
||||
and test_repeated_combination, and make them all timeout:30.
|
||||
|
||||
Tue Mar 8 17:20:21 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* intern.h (rb_divmod): assume compilers `/` and `%` comply C99
|
||||
|
|
|
@ -1819,7 +1819,9 @@ class TestArray < Test::Unit::TestCase
|
|||
|
||||
bug3708 = '[ruby-dev:42067]'
|
||||
assert_equal(b, @cls[0, 1, 2, 3, 4][1, 4].permutation.to_a, bug3708)
|
||||
end
|
||||
|
||||
def test_permutation_stack_error
|
||||
bug9932 = '[ruby-core:63103] [Bug #9932]'
|
||||
assert_separately([], <<-"end;", timeout: 30) # do
|
||||
assert_nothing_raised(SystemStackError, "#{bug9932}") do
|
||||
|
@ -1851,8 +1853,10 @@ 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)})
|
||||
end
|
||||
|
||||
assert_separately([], <<-"end;") # do
|
||||
def test_repeated_permutation_stack_error
|
||||
assert_separately([], <<-"end;", timeout: 30) # do
|
||||
assert_nothing_raised(SystemStackError) do
|
||||
assert_equal(:ok, Array.new(100_000, nil).repeated_permutation(500_000) {break :ok})
|
||||
end
|
||||
|
@ -1886,8 +1890,10 @@ class TestArray < Test::Unit::TestCase
|
|||
|
||||
a = @cls[0, 1, 2, 3, 4][1, 4].repeated_combination(2)
|
||||
assert_empty(a.reject {|x| !x.include?(0)})
|
||||
end
|
||||
|
||||
assert_separately([], <<-"end;") # do
|
||||
def test_repeated_combination_stack_error
|
||||
assert_separately([], <<-"end;", timeout: 20) # do
|
||||
assert_nothing_raised(SystemStackError) do
|
||||
assert_equal(:ok, Array.new(100_000, nil).repeated_combination(500_000) {break :ok})
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue