ruby-changes:41956
From: headius <ko1@a...>
Date: Tue, 8 Mar 2016 23:38:26 +0900 (JST)
Subject: [ruby-changes:41956] headius:r54030 (trunk): test/ruby/test_array.rb: split permute + stack error tests out.
headius 2016-03-08 23:38:22 +0900 (Tue, 08 Mar 2016) New Revision: 54030 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54030 Log: 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. Modified files: trunk/ChangeLog trunk/test/ruby/test_array.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 54029) +++ ChangeLog (revision 54030) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Mar 8 23:37:07 2016 Charles Oliver Nutter <headius@h...> + + * 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@r...> * intern.h (rb_divmod): assume compilers `/` and `%` comply C99 Index: test/ruby/test_array.rb =================================================================== --- test/ruby/test_array.rb (revision 54029) +++ test/ruby/test_array.rb (revision 54030) @@ -1819,7 +1819,9 @@ class TestArray < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L1819 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L1853 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L1890 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/