mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* error.c (exc_equal): clear rb_thread_t::errinfo when ignore
an exception under rb_protect(). [ruby-core:41979] [Bug #5865] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c53470fd47
commit
15e1ff7f23
3 changed files with 28 additions and 1 deletions
|
@ -379,6 +379,8 @@ end.join
|
|||
assert_nothing_raised(NameError, bug5575) do
|
||||
load(t.path)
|
||||
end
|
||||
ensure
|
||||
t.close(true) if t
|
||||
end
|
||||
|
||||
def test_equal
|
||||
|
@ -386,4 +388,21 @@ end.join
|
|||
assert_equal(RuntimeError.new("a"), RuntimeError.new("a"), bug5865)
|
||||
assert_not_equal(RuntimeError.new("a"), StandardError.new("a"), bug5865)
|
||||
end
|
||||
|
||||
def test_exception_in_exception_equal
|
||||
bug5865 = '[ruby-core:41979]'
|
||||
t = Tempfile.new(["test_exception_in_exception_equal", ".rb"])
|
||||
t.puts <<-EOC
|
||||
o = Object.new
|
||||
def o.exception(arg)
|
||||
end
|
||||
RuntimeError.new("a") == o
|
||||
EOC
|
||||
t.close
|
||||
assert_nothing_raised(ArgumentError, bug5865) do
|
||||
load(t.path)
|
||||
end
|
||||
ensure
|
||||
t.close(true) if t
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue