Skip to content

Commit

Permalink
test: repro namespace_scopes compaction issue
Browse files Browse the repository at this point in the history
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
  • Loading branch information
3 people committed Oct 15, 2022
1 parent 7b369e5 commit bed4c87
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/test_compaction.rb
Expand Up @@ -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)
<root xmlns="http://example.com/root" xmlns:bar="http://example.com/bar">
<first/>
<second xmlns="http://example.com/child"/>
<third xmlns:foo="http://example.com/foo"/>
</root>
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

0 comments on commit bed4c87

Please sign in to comment.