diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-07-23 00:32:09 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-07-23 12:01:15 +0900 |
| commit | fc4dd45d0142221880d1b2c9b54dee0597be2b78 (patch) | |
| tree | f0defbf6005cabb4fb05a0e51e620fb2ad21f49e /test/ruby | |
| parent | 63e5f4df387ba24b561c304c56a2f4357de15fe3 (diff) | |
Show exception in finalizer [Feature #17798]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4670
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_objectspace.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_objectspace.rb b/test/ruby/test_objectspace.rb index b48fbc1c15..c26748f516 100644 --- a/test/ruby/test_objectspace.rb +++ b/test/ruby/test_objectspace.rb @@ -161,6 +161,13 @@ End END end + def test_exception_in_finalizer + assert_in_out_err([], "#{<<~"begin;"}\n#{<<~'end;'}", [], /finalizing \(RuntimeError\)/) + begin; + ObjectSpace.define_finalizer(Object.new) {raise "finalizing"} + end; + end + def test_each_object klass = Class.new new_obj = klass.new |
