diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-13 14:50:12 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-13 14:50:12 +0000 |
commit | d61d9d5e8e5a6f7f56e54a2a35e82e209dad6e08 (patch) | |
tree | 030c6e016edc65f3e56f396093a5c1974f69cfcc /test/ruby/test_exception.rb | |
parent | ab6c8910f47a2b95f7338a182715ee0bee5ec45d (diff) | |
download | ruby-d61d9d5e8e5a6f7f56e54a2a35e82e209dad6e08.tar.gz |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_exception.rb')
-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 b437405612..028391d1e6 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 @@ -363,4 +364,20 @@ end.join assert_equal(false, efs.success?, bug5728) assert_equal("msg", efs.message, bug5728) 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 |