diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-03 14:44:20 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-04 04:01:06 +0900 |
commit | 23c92b6f820f670994026423d4c7b5abcf51eafa (patch) | |
tree | d97c74c81911109d6cb714eb775978402d58c92f /spec/ruby | |
parent | 5d9e91afe08c470485333f6c6e034d05ea3ee908 (diff) | |
download | ruby-23c92b6f820f670994026423d4c7b5abcf51eafa.tar.gz |
Revert self-referencing finalizer warning [Feature #15974]
It has caused CI failures.
* d0cd0866d82a58933e5dccd073c753c0c2ad4eb5
Disable GC during rb_objspace_reachable_object_p
* 89cef1c56b3a0f9c5e6ccc22a5044477a4fd16c1
Version guard for [Feature #15974]
* 796eeb6339952d92ae1b353d450c7883e589852d.
Fix up [Feature #15974]
* 928260c2a613bbdd4402c300e0bf86ae7562e52a.
Warn in verbose mode on defining a finalizer that captures the object
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/core/objectspace/define_finalizer_spec.rb | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/spec/ruby/core/objectspace/define_finalizer_spec.rb b/spec/ruby/core/objectspace/define_finalizer_spec.rb index fef7667039..b7e47473a0 100644 --- a/spec/ruby/core/objectspace/define_finalizer_spec.rb +++ b/spec/ruby/core/objectspace/define_finalizer_spec.rb @@ -65,32 +65,4 @@ describe "ObjectSpace.define_finalizer" do ruby_exe(code).lines.sort.should == ["finalized1\n", "finalized2\n"] end - - ruby_version_is "2.7" do - it "warns in verbose mode if it is self-referencing" do - code = <<-RUBY - obj = "Test" - handler = Proc.new { puts "finalized" } - ObjectSpace.define_finalizer(obj, handler) - exit 0 - RUBY - - ruby_exe(code, :options => "-w", :args => "2>&1").should include("warning: object is reachable from finalizer - it may never be run") - end - - it "warns in verbose mode if it is indirectly self-referencing" do - code = <<-RUBY - def scoped(indirect) - Proc.new { puts "finalized" } - end - obj = "Test" - indirect = [obj] - handler = scoped(indirect) - ObjectSpace.define_finalizer(obj, handler) - exit 0 - RUBY - - ruby_exe(code, :options => "-w", :args => "2>&1").should include("warning: object is reachable from finalizer - it may never be run") - end - end end |