diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-13 10:40:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-13 10:40:54 +0000 |
commit | 1590861172ec08b6b10688677364eec6488676cd (patch) | |
tree | ab0702ad23a789b5cea60945d404b68b897b83e3 /test | |
parent | 32a4b080f145888faf6a6662cd127a9332ebab02 (diff) | |
download | ruby-1590861172ec08b6b10688677364eec6488676cd.tar.gz |
test_process.rb: fix error when empty groups
* test/ruby/test_process.rb (test_maxgroups): set one element at
least get rid of ZeroDivisionError when no process groups.
[ruby-core:84224] [Bug #14174]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 58644832d3..c20b8170aa 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1518,6 +1518,7 @@ class TestProcess < Test::Unit::TestCase assert_kind_of(Integer, max) gs = Process.groups assert_operator(gs.size, :<=, max) + gs[0] ||= 0 assert_raise(ArgumentError) {Process.groups = gs * (max / gs.size + 1)} end |