Skip to content

Commit

Permalink
Reproduce GC crash in xml_node_set_mark
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Dec 9, 2024
1 parent 8b605df commit 16f3df5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/xml/test_document_fragment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,18 @@ def test_dup_creates_tree_with_identical_structure
assert_equal(original.to_html, duplicate.to_html)
end

def test_dup_creates_tree_with_identical_structure_stress
original = Nokogiri::XML::DocumentFragment.parse("<div><p>hello</p></div>")
duplicate = original.dup
stress_was = GC.stress
GC.stress = true
begin
assert_equal(original.to_html, duplicate.to_html)
ensure
GC.stress = true
end
end

def test_dup_creates_mutable_tree
original = Nokogiri::XML::DocumentFragment.parse("<div><p>hello</p></div>")
duplicate = original.dup
Expand Down

0 comments on commit 16f3df5

Please sign in to comment.