From: <bo...@us...> - 2008-03-26 05:02:08
|
Revision: 254 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=254&view=rev Author: bodewig Date: 2008-03-25 22:02:03 -0700 (Tue, 25 Mar 2008) Log Message: ----------- normalizeWhitespace trims text and this is by design Modified Paths: -------------- trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java trunk/xmlunit/tests/java/org/custommonkey/xmlunit/test_Diff.java Modified: trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java =================================================================== --- trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java 2008-03-26 04:33:47 UTC (rev 253) +++ trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java 2008-03-26 05:02:03 UTC (rev 254) @@ -736,7 +736,8 @@ * * <p>Normalized in this context means that all whitespace is * replaced by the space character and adjacent whitespace - * characters are collapsed to a single space character.</p> + * characters are collapsed to a single space character. It will + * also trim the resulting character content on both ends.</p> * * <p>The default value is false.</p> * Modified: trunk/xmlunit/tests/java/org/custommonkey/xmlunit/test_Diff.java =================================================================== --- trunk/xmlunit/tests/java/org/custommonkey/xmlunit/test_Diff.java 2008-03-26 04:33:47 UTC (rev 253) +++ trunk/xmlunit/tests/java/org/custommonkey/xmlunit/test_Diff.java 2008-03-26 05:02:03 UTC (rev 254) @@ -671,7 +671,7 @@ public void testNormalizedWhitespace() throws Exception { String xml1 = "<foo>a = b;</foo>"; - String xml2 = "<foo>\r\n\ta = b; \r\n</foo>"; + String xml2 = "<foo>\r\n\ta =\tb; \r\n</foo>"; try { assertFalse(buildDiff(xml1, xml2).identical()); assertFalse(buildDiff(xml1, xml2).similar()); @@ -743,21 +743,4 @@ XMLUnit.setIgnoreWhitespace(false); } } - - /** - * @see https://sourceforge.net/forum/message.php?msg_id=4843316 - */ - public void XtestNormalizeWhiteSpaceDoesntStripLeadingSpace() - throws Exception { - String control = "<name>value</name>"; - String test = "<name> value</name>"; - XMLUnit.setNormalizeWhitespace(true); - try { - Diff diff = XMLUnit.compareXML(control, test); - assertFalse(diff.toString(), diff.similar()); - } finally { - XMLUnit.setNormalizeWhitespace(false); - } - } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |