Skip to content

Commit e54cd33

Browse files
committed
test: update tests to reflect upstream libxml2 text node coalescing
A text node coalescing bug was fixed in GNOME/libxml2@4ccd3eb8, and although Nokogiri handles this fine from a memory perspective, the tests need to be updated to reflect the new behavior.
1 parent 021ed7d commit e54cd33

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/xml/test_node_reparenting.rb

+10-2
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,11 @@ def coerce(data)
623623
assert_equal "after", after.content
624624
refute_nil after.parent, "unrelated node should not be affected"
625625

626-
assert_equal "before", before.content
626+
if Nokogiri.uses_libxml?(">= 2.13.0")
627+
assert_equal "beforex", before.content # coalescing fixed in gnome/libxml2@4ccd3eb8
628+
else
629+
assert_equal "before", before.content
630+
end
627631
refute_nil before.parent, "no need to reparent"
628632
end
629633
end
@@ -662,7 +666,11 @@ def coerce(data)
662666
assert_equal "before", before.content
663667
refute_nil before.parent, "unrelated node should not be affected"
664668

665-
assert_equal "after", after.content
669+
if Nokogiri.uses_libxml?(">= 2.13.0")
670+
assert_equal "xafter", after.content # coalescing fixed in gnome/libxml2@4ccd3eb8
671+
else
672+
assert_equal "after", after.content
673+
end
666674
refute_nil after.parent
667675
end
668676
end

0 commit comments

Comments
 (0)