aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-13 20:47:36 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-13 20:47:36 +0000
commit5c4db58b1240737e0058d856c3cc92c0841f2d0c (patch)
tree8738818a4789674f48938bffff8e6ec302295e8b /test/ruby/test_process.rb
parent24873d1a0520ceef39c1c492c6b02dbbc186d8ff (diff)
downloadruby-5c4db58b1240737e0058d856c3cc92c0841f2d0c.tar.gz
process.c: handle dynamic :rlimit_* symbols in spawn execopts
* process.c (rb_execarg_addopt_rlimit): hoist out of rb_execarg_addopt (rlimit_type_by_sym): new wrapper for dynamic symbol (rb_execarg_addopt): check for dsym via rlimit_type_by_sym * test/ruby/test_process.rb (test_execopts_rlimit): check dsym w/o pindown Add extra check for bogus rlimit args, too. [ruby-core:82033] [Bug #13744] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 95d32dbced..41b8b68d9d 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -242,6 +242,18 @@ class TestProcess < Test::Unit::TestCase
:rlimit_core=>n, :rlimit_cpu=>3600]) {|io|
assert_equal("[#{n}, #{n}]\n[3600, 3600]", io.read.chomp)
}
+
+ assert_raise(ArgumentError) do
+ system(RUBY, '-e', 'exit', 'rlimit_bogus'.to_sym => 123)
+ end
+ assert_separately([],<<-"end;") # [ruby-core:82033] [Bug #13744]
+ assert(system("#{RUBY}", "-e",
+ "exit([3600,3600] == Process.getrlimit(:CPU))",
+ 'rlimit_cpu'.to_sym => 3600))
+ assert_raise(ArgumentError) do
+ system("#{RUBY}", '-e', 'exit', :rlimit_bogus => 123)
+ end
+ end;
end
MANDATORY_ENVS = %w[RUBYLIB]