summaryrefslogtreecommitdiff
path: root/test/ruby/test_optimization.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_optimization.rb')
-rw-r--r--test/ruby/test_optimization.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index c035a112cb..2589494596 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -328,18 +328,21 @@ eval <<EOF
def foo
foo
end
+puts("start")
+STDOUT.flush
foo
EOF
EOS
- err = EnvUtil.invoke_ruby([], "", true, true, {}) {
+ status, err = EnvUtil.invoke_ruby([], "", true, true, {}) {
|in_p, out_p, err_p, pid|
in_p.write(script)
in_p.close
- sleep(1)
+ out_p.gets
Process.kill(:SIGINT, pid)
- Process.wait(pid)
- err_p.read
+ *, stat = Process.wait2(pid)
+ [stat, err_p.read]
}
+ assert_equal(Signal.list["INT"], status.termsig)
assert_match(/Interrupt/, err, bug)
end