зеркало из https://github.com/github/ruby.git
Refined assertion messages
This commit is contained in:
Родитель
521e25baa4
Коммит
dc0c04764f
|
@ -246,18 +246,16 @@ class TestProcess < Test::Unit::TestCase
|
|||
assert_raise(ArgumentError) do
|
||||
system(RUBY, '-e', 'exit', 'rlimit_bogus'.to_sym => 123)
|
||||
end
|
||||
assert_separately([],"#{<<-"begin;"}\n#{<<~'end;'}")
|
||||
assert_separately([],"#{<<~"begin;"}\n#{<<~'end;'}", 'rlimit_cpu'.to_sym => 3600)
|
||||
BUG = "[ruby-core:82033] [Bug #13744]"
|
||||
RUBY = "#{RUBY}"
|
||||
begin;
|
||||
assert(system("#{RUBY}", "-e",
|
||||
"exit([3600,3600] == Process.getrlimit(:CPU))",
|
||||
'rlimit_cpu'.to_sym => 3600), BUG)
|
||||
assert_raise(ArgumentError, BUG) do
|
||||
system("#{RUBY}", '-e', 'exit', :rlimit_bogus => 123)
|
||||
end
|
||||
assert_equal([3600,3600], Process.getrlimit(:CPU), BUG)
|
||||
end;
|
||||
|
||||
assert_raise_with_message(ArgumentError, /bogus/) do
|
||||
system(RUBY, '-e', 'exit', :rlimit_bogus => 123)
|
||||
end
|
||||
|
||||
assert_raise_with_message(ArgumentError, /rlimit_cpu/) {
|
||||
system(RUBY, '-e', 'exit', "rlimit_cpu\0".to_sym => 3600)
|
||||
}
|
||||
|
@ -636,7 +634,7 @@ class TestProcess < Test::Unit::TestCase
|
|||
rescue NotImplementedError
|
||||
return
|
||||
end
|
||||
assert(FileTest.pipe?("fifo"), "should be pipe")
|
||||
assert_file.pipe?("fifo")
|
||||
t1 = Thread.new {
|
||||
system(*ECHO["output to fifo"], :out=>"fifo")
|
||||
}
|
||||
|
@ -1635,7 +1633,7 @@ class TestProcess < Test::Unit::TestCase
|
|||
w.puts
|
||||
end
|
||||
Process.wait pid
|
||||
assert sig_r.wait_readable(5), 'self-pipe not readable'
|
||||
assert_send [sig_r, :wait_readable, 5], 'self-pipe not readable'
|
||||
end
|
||||
if RubyVM::MJIT.enabled? # checking -DMJIT_FORCE_ENABLE. It may trigger extra SIGCHLD.
|
||||
assert_equal [true], signal_received.uniq, "[ruby-core:19744]"
|
||||
|
@ -2260,7 +2258,7 @@ EOS
|
|||
th = Process.detach(pid)
|
||||
assert_equal pid, th.pid
|
||||
status = th.value
|
||||
assert status.success?, status.inspect
|
||||
assert_predicate status, :success?
|
||||
end if defined?(fork)
|
||||
|
||||
def test_kill_at_spawn_failure
|
||||
|
|
Загрузка…
Ссылка в новой задаче