xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
[XOM-interest] XOMTestCase.compareChildren() should be insensitive to empty text nodes
- From: Wolfgang Hoschek <wolfgang.hoschek AT mac.com>
- To: xom-interest AT lists.ibiblio.org
- Subject: [XOM-interest] XOMTestCase.compareChildren() should be insensitive to empty text nodes
- Date: Thu, 25 Jan 2007 16:16:29 -0800
XOMTestCase.compareChildren() compares two children for "equality". Ala XPath, it merges adjacent text nodes before doing so, which is fine, but the comparison isn't insensitive to empty text nodes, which seems wrong for all intents and purposes. The following test case should pass but currently fails:
public void testEmptyTextComparison() {
Element expected = new Element("foo");
Element actual = new Element("foo");
actual.appendChild(new Text(""));
assertEquals("Comparison should be insensitive to empty text nodes", expected, actual);
actual.appendChild(new Text(""));
assertEquals("Comparison should be insensitive to empty text nodes", expected, actual);
actual.appendChild(new Text(""));
assertEquals("Comparison should be insensitive to empty text nodes", expected, actual);
expected.appendChild(new Text(""));
assertEquals("Comparison should be insensitive to empty text nodes", expected, actual);
}
-
[XOM-interest] XOMTestCase.compareChildren() should be insensitive to empty text nodes,
Wolfgang Hoschek, 01/25/2007
- Re: [XOM-interest] XOMTestCase.compareChildren() should be insensitive to empty text nodes, Elliotte Harold, 01/26/2007
Archive powered by MHonArc 2.6.24.