mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 10:03:59 +02:00
* eval.c (setup_exception): internal exception should be hidden
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bfb8b125fa
commit
2082417a48
5 changed files with 36 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
require 'test/unit'
|
||||
require 'timeout'
|
||||
require 'tempfile'
|
||||
require_relative 'envutil'
|
||||
|
||||
class TestSignal < Test::Unit::TestCase
|
||||
|
@ -195,4 +196,28 @@ class TestSignal < Test::Unit::TestCase
|
|||
w.close
|
||||
assert_equal(r.read, "foo")
|
||||
end
|
||||
|
||||
def test_signal_requiring
|
||||
t = Tempfile.new(%w"require_ensure_test .rb")
|
||||
t.puts "sleep"
|
||||
t.close
|
||||
error = IO.popen([EnvUtil.rubybin, "-e", <<EOS, t.path, err: :close]) do |child|
|
||||
th = Thread.new do
|
||||
begin
|
||||
require ARGV[0]
|
||||
ensure
|
||||
Marshal.dump($!, STDOUT)
|
||||
end
|
||||
end
|
||||
STDOUT.puts
|
||||
STDOUT.flush
|
||||
th.join
|
||||
EOS
|
||||
child.gets
|
||||
Process.kill("INT", child.pid)
|
||||
Marshal.load(child)
|
||||
end
|
||||
t.close!
|
||||
assert_nil(error)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue