diff --git a/test/test_compaction.rb b/test/test_compaction.rb index 5b0720f670..fbe247f38e 100644 --- a/test/test_compaction.rb +++ b/test/test_compaction.rb @@ -18,4 +18,22 @@ # access the node wrappers and make sure they didn't move doc.root.children.each(&:inspect) end + + it "namespace_scopes compact" do + skip unless GC.respond_to?(:verify_compaction_references) + + doc = Nokogiri::XML(<<~EOF) + + + + + + EOF + + doc.at_xpath("//root:first", "root" => "http://example.com/root").namespace_scopes.inspect + + GC.verify_compaction_references(double_heap: true, toward: :empty) + + doc.at_xpath("//root:first", "root" => "http://example.com/root").namespace_scopes.inspect + end end