diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-08 00:44:05 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-08 00:44:05 +0000 |
commit | 79634569e483d82874c9eaadf0d3a61c1b529fa8 (patch) | |
tree | aea23d11a3cde8a68741cb49dd69b7aff6d590af /test | |
parent | b7f40d86af3e98c4481caf1014ba5423901d4580 (diff) |
merge revision(s) 34028,34030:
* error.c (name_err_mesg_to_str): clear rb_thread_t::errinfo when
ignore exception under rb_protect().
* test/ruby/test_exception.rb (test_exception_in_name_error_to_str):
add a corresponding test.
ignore exception under rb_protect(). [ruby-core:41612] [Bug #5755]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_exception.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index a26ade075b..b410b708b5 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1,4 +1,5 @@ require 'test/unit' +require 'tempfile' require_relative 'envutil' class TestException < Test::Unit::TestCase @@ -316,4 +317,20 @@ end.join def test_errno assert_equal(Encoding.find("locale"), Errno::EINVAL.new.message.encoding) end + + def test_exception_in_name_error_to_str + bug5575 = '[ruby-core:41612]' + t = Tempfile.new(["test_exception_in_name_error_to_str", ".rb"]) + t.puts <<-EOC + begin + BasicObject.new.inspect + rescue + $!.inspect + end + EOC + t.close + assert_nothing_raised(NameError, bug5575) do + load(t.path) + end + end end |