I am testing comparisons of standard and self-terminating elements and came across an interesting issue. The following works fine, as I would have expected:
string input1 = "<empty/>";
string input2 = "<empty></empty>";
AssertExpectedResult(input1, input2, true);
AssertExpectedResult(input2, input1, true);
When I add an attribute to the elements, the order of the comparison parameters dictates whether they are considered equal or not:
string input1 = "<empty name='Test'/>";
string input2 = "<empty name='Test'></empty>";
AssertExpectedResult(input1, input2, true); // Passes
AssertExpectedResult(input2, input1, true); // Fails
The failure error is: CHILD_NODELIST_LENGTH_ID and appears to stem from the processing of the test XmlReader.Read() result. I would have expected both asserts to either pass or fail. I'm currently pre-processing all XML to prevent empty nodes from existing to work around this, but is there anything I can do with XmlUnit itself to resolve this?
the .NET version still is somewhat neglected. I'd consider what you see a bug, please open a bug report for it.
A unit test ready to be added to the source tree and - if you can track it down - a patch would be much appreciated.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.